#is there any way to replace or remove items from the player on use?

1 messages · Page 1 of 1 (latest)

viscid portal
#

shrimple as the title suggests. for example, if you "use"/place a lava bucket, it gives you a bucket, right? is there any way to replace what item that is given to the player?

neat tangle
#

Sure. Detect the use with an advancement that then runs a reward function to replace the item in their hand with either an /item or /loot command

rugged vault
#

The above is the more versatile way of working and what you need for a bucket.

Food, projectiles, fully degraded items (0 durability) etc. have a more efficient way to achieve this by adding the use_remainder component. This does not trigger when "using" a fishing rod, sword etc. as the remainder only applies to the use that would otherwise "delete" or "convert" the item.