How to change an Entity's NBT tag

Started by RyanDxxx on

Topic category: Help with MCreator software

Last seen on 11:27, 15. Apr 2023
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to change an Entity's NBT tag

Been trying to look everywhere for something, but either they're outdated, server/client doesn't sync up, etc. I've tried simply just adding a "Set [Event/target entity] custom number NBT tag ["Color"] to [0]", but it doesn't sync up.
https://imgur.com/a/5rV6gI2
Image to show what I've got so far.
But it's just something simple as right-clicking on a Shulker with a piece of dye, then changing the Shulker's {Color:[number]} NBT to match the color of the dye used then removing a piece of that dye used, yet been trying a few different pieces of code and can't land on one that is synced up and works, been trying for like half an hour but hoping any of yall might know? If so, thanks in advance.

Last seen on 11:27, 15. Apr 2023
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://imgur.com/a…
Thu, 01/19/2023 - 10:15

https://imgur.com/a/xkI7cbe
This is what it looks like with the "Set [event/target entity custom number NBT tag" blablabla, etc. It's give me a bunch of not synced errors, and testing it ingame, doesn't do anything except everything else like consuming the dye, the sound, etc. I've been trying everything and still just nothing.

Last seen on 11:27, 15. Apr 2023
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Been testing it a bit more,…
Thu, 01/19/2023 - 10:55

Been testing it a bit more, it does change it, kinda it creates a new tag {Color:[Number]} but instead of just like 0-15, the number becomes 0.0d, which isn't what I want, and especially a new nbt tag, I wanna change a tag, but it just seems like MCreator has no way of it doing it except executing a ingame command.

 

Last seen on 02:37, 13. Apr 2024
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just tried playing around…
Thu, 01/19/2023 - 18:36

I just tried playing around with it (in 1.16.5 if that makes any difference) and got the same results.

After my initial testing, though, I ended up making a simple procedure that executes "/data merge entity @s {Color: 0}" in the name of the shulker - when the player right-clicks an entity (that is a shulker).

Genuinely asking, what would be wrong with executing a command to achieve the result you're after?

Last seen on 11:27, 15. Apr 2023
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Will's Aquatic Craft Yeah I…
Thu, 01/19/2023 - 20:38

Will's Aquatic Craft Yeah I decided to just do that in the end like a few hours ago, and to be honest, I never knew it'd work like that, when I was scrolling through, I stumbled across "Execute command by [player/entity]" basically the one that executes a command on behalf of a player, and when thinking about it, you'd have to be opped and just didn't do it cause it meant normal player's wouldn't be able to dye shulkers, but then when scrolling through I did come across the procedure that executed it without the use of a player which was perfect.

It isn't that I'm against it, I just didn't see the procedure, my bad but thanks anyway. Sorry for my mistake.

Last seen on 02:37, 13. Apr 2024
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Haha, no problem! I love it…
Thu, 01/19/2023 - 22:30

Haha, no problem! I love it when you wrack your brains out trying to find a solution to something and nothing seems to work right, and then you finally find a very simple solution that just... works.