Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Check all items in a chest for a specific item [1.8.9]


portalthree
 Share

Recommended Posts

if (ToggleCommand.) {
    if (Minecraft.getMinecraft().instanceof GuiChest) {
        GuiChest = (GuiChest) Minecraft.getMinecraft().;
        ContainerChest = (ContainerChest) .;
        String = .getLowerChestInventory().getDisplayName().getUnformattedText();
        if (.trim().startsWith("Select all the SILVER items!")) {
            System.out.println();
            if(cc.getLowerChestInventory().getStackInSlot().getDisplayName().startsWith("Silver")){
                System.out.println("Silver block detected");
            } else {
                return;
            }
        } else {
            return;
        }
    }
}

I need to check all the items in cc to see if there is an item wich name start with "Silver", if i use getStackInSlot() i have to specify wich slot i want to check and that's not effecient since i'll have to copy that lign like 40 times.

Edited by portalthree
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.