#item replacer
15 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
event.player.inventory.setStackInSlot(<slot number>, <Itemstack>) if you want to overwrite the item in a slot
depends on what you want to achieve
i want an item to be replaced whenever its in his iventory
mabye when inventory changes
so it even works when u run /give command
then you should listen to the the inventory changed event and then do:
if(event.item.id == "minecraft:stone"){
event.entity.inventory.setStackInSlot(event.slot, Item.of(""))
}
idk if this is the best way but should work
like this PlayerEvents.inventoryChanged
if(event.item.id == "minecraft:stone"){
event.entity.inventory.setStackInSlot(event.slot, Item.of(""))
}
PlayerEvents.inventoryChanged
if(event.item.id == "minecraft:stone"){
event.entity.inventory.setStackInSlot(event.slot, Item.of(""))
}
doesnt work