Inserting only specific items into a slot

Started by VegaOrionis on

Topic category: Help with MCreator software

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Inserting only specific items into a slot

Is it possible to set slots in the created block to only put specific items into it?

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, thanks, I will check…
Fri, 09/26/2025 - 19:24

Okay, thanks, I will check in practice someday whether it will really work.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if you just want a few items…
Tue, 09/30/2025 - 19:14

if you just want a few items, like 2, you can just add an or statement like,

return (new ItemStack(Blocks.GOLD_BLOCK, 1).getItem() == stack.getItem()) || (new ItemStack(Items.STICK, 1).getItem() == stack.getItem());

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I need to learn Java someday…
Tue, 09/30/2025 - 19:25

I need to learn Java someday, Thanks for the help, it works!