/item replace replacing an item that has been used with a usable item makes the item invisible
The command below replaces the player's held item slot with a carrot if it has anything other than a carrot.
/item replace entity @a[nbt=!{SelectedItem:{id:"minecraft:carrot"}}] weapon.mainhand with minecraft:carrot
If this command is put in a repeating command block and you eat a carrot in survival mode it will try replace the item in your hand, but it will appear invisible until you update the slot.
2024-08-22, 07:42 AM
2024-08-22, 07:48 AM
2024-08-22, 07:48 AM
0
0
-