forge 1.20.1 "public boolean mayTake(ItemStack stack)"

Started by AydenC77 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
forge 1.20.1 "public boolean mayTake(ItemStack stack)"

hey guys) im trying to make a filter for hoppers and the hoppers keep imputing and taking items out of the filtered item slot how do i fix this heres my current code


        this.customSlots.put(0, this.addSlot(new SlotItemHandler(internal, 0, 25, 35) {
            private final int slot = 0;

            @Override
            public void setChanged() {
                super.setChanged();
                slotChanged(0, 0, 0);
            }

            @Override
            public void onTake(Player entity, ItemStack stack) {
                super.onTake(entity, stack);
                slotChanged(0, 1, 0);
            }

            @Override
            public boolean mayTake(ItemStack stack) {
                return entity instanceof Player;
            }
        }));


i keep getting this error its probable a simple fix im jest dumb

error: method does not override or implement a method from a supertype @Override
                                                                                                                                     ^

This does not look like a…
Tue, 01/16/2024 - 17:09

This does not look like a code that would work. I would recommend investing time in learning Java and the modding API you use before writing code