[Solved] Why is my NBT upcounting not working?

Started by RaidenvBlack on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Solved] Why is my NBT upcounting not working?
Sat, 05/07/2022 - 23:19 (edited)

Hello

i want that the mobs gets upgraded after killing 20 mobs and i made this procedure to let it all the time trigger when i kill an mob. 

Sadly it is not working and don't count up when i make this on the entity kills another one option. I also made a procedure on spawn to set the xp NBT number to 0.

https://imgur.com/a/R9GBLMc

I hope someone can help me (also the despawn element is not working for me maybe someone knows there a solution too)

Thanks in advance ^^

Edited by RaidenvBlack on Sat, 05/07/2022 - 23:19
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
set variable xp back to 0 or…
Thu, 05/05/2022 - 20:11

set variable xp back to 0 or the first number.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
excuse me i don't understand…
Thu, 05/05/2022 - 20:15

excuse me i don't understand that maybe you could explain me that a bit more because how should it help me if i want to count the xp up to set it back to 0 ? and what do you mean with the first number ? 

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I mean "xp" is your nbt tag…
Thu, 05/05/2022 - 20:28

I mean "xp" is your nbt tag right. So when xp reaches 20, you do whatever you need, then set xp back to 0, so it loops over and over again. Unless I misunderstood. And also despawn isn't working because you targeted the event/target entity not the newly spawned entity.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
My problem is that it not…
Thu, 05/05/2022 - 20:32

My problem is that it not even counts up to 20 and i don't know why. I tested it now multiple times and i want that the event entitiy despawns because there the new entity will spawn. And yes xp is my nbt tag.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That's quite easy Make a…
Thu, 05/05/2022 - 20:42

That's quite easy

Make a global variable call it let's say A - number variable if on player make it persistent if on mob make it world

Open a procedure when entity killed and place if SOURCE = your evolving mob then set variable to get variable +1

On your evolving mob in mob tick update pleace: if variable = 20 then spawn new entity + despawn old entity

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But my problem is if i make…
Thu, 05/05/2022 - 20:51

But my problem is if i make it with global variable and i spawn multiple of my starting mobs then it is global so for every mob the same and i want to have it for every mob individual thats why i tried it with NBT what is somehow not working. And when this Mobs kill other mobs like sheeps or pigs or zombies they should evolve (despawn and spawn upgraded version from the mob) after 20 kills. 

Maybe you could tell me why my version is not working i mean i set the tag let it count up (what is somehow not working as it looks)and then after 20 kills it should spawn the upgraded version and delete the old one.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes of course when global…
Thu, 05/05/2022 - 20:59

Yes of course when global variable is reached then all mobs evolve

If you want a single mob to evolve after 20 and each mob must kill 20 then just set an NBT procedure to your entity which triggers under global variable condition

For example set nbt to get nbt +1 and when nbt = 20 then evolve your mob. This way each single mob must kill 20 before evolving

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i mean i did that as you can…
Thu, 05/05/2022 - 21:01

i mean i did that as you can see in the picture i added in my post but this is not working and i don't know why 

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nah your pictures shows…
Thu, 05/05/2022 - 21:06

Nah your pictures shows nothing

Do not trigger a global variable is just an nbt procedure

 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
could you maybe explain me a…
Thu, 05/05/2022 - 21:11

could you maybe explain me a bit more what you mean with ,,trigerring an NBT procedure to your entity which triggers under global variable condition'' ? what do i need to do with the global variable in detail to connect it with my nbt tag ? thank you that you try to help 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe if someone wants to do…
Sat, 05/07/2022 - 23:07

Maybe if someone wants to do the same someday i post here my solution. I think that if entity kills another one trigger is a bit bugged so i solved it now like this https://imgur.com/a/lIWR9Ju