So I set up a simple scoreboard with stat.use.item so that when a player ate a cookie speed was applied to him. Right now I'm trying to make different cookies give you different effects however I have absolutely no idea how nbt tags work or what to use to differentiate between them.
So I set up a simple scoreboard with stat.use.item so that when a player ate a cookie speed was applied to him. Right now I'm trying to make different cookies give you different effects however I have absolutely no idea how nbt tags work or what to use to differentiate between them.
Is there any chance any of you nice hunks could help me out?
Alternatively instead of checking for nbt tags or something being able to check for a specific name would be great.
Thanks!
So let's say you have a cookie named "speed" and you want to apply a speed effect to the player if they eat it. The way I would go about doing this is:
tag the player when they are holding the named cookie
detect the cookie being eaten
apply an effect depending on the tag previously stored
Paste these three commands into a chain of command blocks (see included image):
So I set up a simple scoreboard with stat.use.item so that when a player ate a cookie speed was applied to him. Right now I'm trying to make different cookies give you different effects however I have absolutely no idea how nbt tags work or what to use to differentiate between them.
/scoreboard objectives add eatcookie minecraft.used:minecraft.cookie
Is there any chance any of you nice hunks could help me out?
Alternatively instead of checking for nbt tags or something being able to check for a specific name would be great.
Thanks!
So let's say you have a cookie named "speed" and you want to apply a speed effect to the player if they eat it. The way I would go about doing this is:
Paste these three commands into a chain of command blocks (see included image):
Note: This system will only work for cookies with names generated via /give. It will now work if you rename the cookie in an anvil.
to generate the cookie, use:
if you want to make it work with an anvil, use this instead of the first command:
make sure all the command blocks are always active and the third one is conditional.
Some of my projects:
https://www.curseforge.com/members/megacrafter1077/projects
https://datapackcenter.com/projects/adventure.104/
My tutorials:
https://datapackcenter.com/projects/data-pack-basics.71/
https://datapackcenter.com/projects/loot-tables.72/
https://datapackcenter.com/projects/custom-crafting-tutorial.70/
https://datapackcenter.com/projects/custom-item-models-tutorial.69/
https://datapackcenter.com/projects/raycasting-tutorial.68/
Thank you so much!
This was really my biggest problem atm