#Specific item in inventory

1 messages · Page 1 of 1 (latest)

vague oxide
#

How to write something on the screen if the player has a specific item in his inventory?

minor apex
#
const inv = player.getComponent("inventory").container

for (let i = 0; i < inv.size; i++) {
  const item = inv.getItem(i)

  if (item?.typeId == "minecraft:stick")
    player.tell("You have stick")
}