is there a way to check if there is a specific item in the player's inventory?
SamukaDEV opened this issue ยท 3 comments
more comprehensive documentation would be very interesting, I can't find many doubts that I find about methods and properties of events and functions, I would love new content in the documentation.
Use the player.inventory.xxxx
events.
For the change event, entity
/ item
/ slot
will tell you about the change.
For opening or closing an inventory, entity
/ inventoryContainer
are available. inventoryContainer
is a PlayerContainer from the Forge API, not a KubeJS wrapper, so it could break in future versions of the Forge API, Minecraft, etc. You probably want the inventorySlots
property.
For better documentation, read the source code like this and update the wiki.
Actually, a better approach would be to call event
. player
. inventory
and then do what you want.