Custom items in custom code

Started by Maks1709 on

Topic category: Help with modding (Java Edition)

Last seen on 17:58, 6. Feb 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom items in custom code

I made a gui with slot limited to a couple items with custom code but it doesn't with custom blocks :/ (I fvcked up the id when creating, it should be right cuz i copied it from orginal code)

this.customSlots.put(1, this.addSlot(new SlotItemHandler(internal, 1, 97, 21) {
                @Override
                public boolean isItemValid(ItemStack stack) {
                    return (Blocks.DIRT.asItem() == stack.getItem()) || (LemonSamplingBlock.block.asItem() == stack.getItem());