Help with remotely detonating an item using NBT tags

Started by SnailsAttack on

Topic category: Help with MCreator software

Last seen on 15:49, 25. Mar 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with remotely detonating an item using NBT tags

I would like to know how to use NBT tags to make items of a specific type blow up a few seconds after they are dropped, but I am not sure how to do this.

There doesnt seem to be a way to get a dropped item to tell itself to blow up after a specified amount of time since it doesnt tick, so I believe the command to detonate the item needs to be powered by the "on world tick update" global trigger which remotely detonates the item via counting every tick after the item is dropped until it reaches a certain value.

So basically when a specific item is dropped in the world I give it an NBT tag. This is easy to do. But then I need to have the "on world tick update" global trigger tell items with that NBT tag to detonate after several seconds. I don't know how to do that. I also don't know if this is the correct way of going about the process, but I have been told that it might be.

Last seen on 15:49, 25. Mar 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Posted this two days ago but…
Sat, 10/17/2020 - 14:26

Posted this two days ago but haven't gotten any responses so I'm gonna bump it once and give up if i still dont get nothin

Last seen on 23:11, 16. Jul 2023
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Don't use NBT tags, use…
Sat, 10/17/2020 - 15:15

Don't use NBT tags, use global variables that, once you click, changes to true so something exploded and immediately change it to false back so it can be used again

Last seen on 15:49, 25. Mar 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
uhh alright
Sat, 10/17/2020 - 15:44

uhh alright

Last seen on 14:30, 2. Aug 2022
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you use the world tick…
Mon, 10/19/2020 - 18:14

If you use the world tick update trigger to run these two commands:

"execute as @e[type=minecraft:item,nbt={Item:{id:"mod_name:item_name"}}] store result entity @s Item.tag.Fuse double 0.9 run data get entity @s Item.tag.Fuse"

"execute as @e[type=minecraft:item,nbt={Item:{id:"mod_name:item_name",tag:{Fuse:0.0d}}}] at @s run summon minecraft:tnt ~ ~ ~"

Just replace mod_name:item_name with your information and make sure you give the bombs a fuse tag and you'll be good to go.

Last seen on 15:49, 25. Mar 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks. I did find a better…
Sun, 11/08/2020 - 14:47

Thanks.

I did find a better way of doing it though, which was to call a player tick update procedure which updates every item of my specified type in a cube of about 150 meters, so I can give them NBT clocks and such. Works fantastic, though it probably tanks performance and would make a mojang dev scream.

Originally I had used a world procedure which checked every item in a square cube of 99999999 meters from the spawn origin, but that crashed the game. Hence the "if a tree falls in the forest does it make a sound" approach where I localize the clocks to areas where the player is actually at.