Restrict Inventory Slots in a Block's GUI

Started by ManuGaming on

Topic category: Help with modding (Java Edition)

Last seen on 18:05, 20. Nov 2021
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Restrict Inventory Slots in a Block's GUI
Wed, 10/06/2021 - 12:38 (edited)

Hello fellow modders,

Is it possible to restrict certain inventory slots in a block's GUI from being accessed by players / only allow the player to insert certain items into these slots?

I already know about 

CustomTileEntity.canExtractItem(int, ItemStack, Direction): Boolean
CustomTileEntity.canInsertItem(int, ItemStack, Direction): Boolean

but this only works for adjacent blocks inserting into / extracting from the block's inventory. You can still insert Items into "blocked" slots by using the block's GUI. I couldn't find anything about this topic on the forum so I believe this question has not yet been asked.

Thanks in advance

Edited by ManuGaming on Wed, 10/06/2021 - 12:38