Procedure Spawn/Despawn (Store Current HP)

Started by ninjawizard1234 on

Topic category: Help with modding (Java Edition)

Last seen on 04:46, 14. Mar 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure Spawn/Despawn (Store Current HP)

hey guys im trying to make a procedure to Sit mobs (2 entities - regular and sit), spawning / despawning them, i just need a way to save the Current HP and transfer to the new spawned entity, could you guys give a hand :) thanks!

Last seen on 14:57, 22. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You don't need an NBT tag…
Tue, 11/21/2023 - 17:19

You don't need an NBT tag for this if you're only referencing it in one procedure. Just make a local number variable, set the variable to the original entity's health before you despawn it, then set the new entity's health to the variable after you spawn it in.

Last seen on 04:46, 14. Mar 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
rand/var? oh true man, i…
Tue, 11/21/2023 - 18:36

rand/var? oh true man, i wish i would remember that, last time i update my mod was 4 years ago lol thanks!

 would you care to show us how it can be done with local var? ( a screenshot would greatly help the begginers too)

Last seen on 04:46, 14. Mar 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the other problem with this…
Tue, 11/21/2023 - 18:39

the other problem with this code is that command line, 

/summon wizard_animals_plus:capuchin_blond ~ ~ ~ {Tame:1,Owner:Player}

that tame the mob but not BY the player for some reason, the tamed mob wont follow the player for some reason

i tried with the procedures but i also dont know how to Tame a mob you just spawned on the procedure (since i cant target it as 'EventEntity' or nothing,

thanks again man!

Last seen on 14:57, 22. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here's an example of how you…
Tue, 11/21/2023 - 18:58

Here's an example of how you'd replace an entity using a local variable. The 'If' check isn't strictly necessary, but it's a good idea to include one anyways when you're using nearest entity, as this can crash the game if it returns null. 

Not sure about the taming thing, but it might be a bug. Worth looking into I guess? If it's just the one function that's broken, you could also consider seeing how other modders do it on Github, in case the syntax changed and it just wasn't updated on MCreator.

Last seen on 04:46, 14. Mar 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oooh u mean the local rand …
Tue, 11/21/2023 - 21:43

oooh u mean the local rand (var) on the right i remember now man thank you so much!

about the taming comand - maybe the `Player' dont mean the currentPlayer? yeah i would love to see if the syntax changed, you have any idea where can i look at it?

thanks again :)

Last seen on 14:57, 22. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Unfortunately there aren't…
Wed, 11/22/2023 - 01:24

Unfortunately there aren't great places to look, at least not that I know of. Mojang usually keeps a log of stuff they've changed, but it tends to be buried in really long technical changelogs, so it's easy for devs to miss stuff. 

As for taming, I'd assume you run it through some sort of 'player right clicks on entity,' in which case the source entity would be the one doing the right clicking. (I think.) You're trying to set NBT data for the source entity in the original post- is it possible the taming function is referencing the wrong entity? Or that your entity isn't set to be tameable?

'

Last seen on 04:46, 14. Mar 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nah the entity tames…
Wed, 11/22/2023 - 21:26

nah the entity tames normally with the food item, then after, when i make it Sit (change entity), the command make the new sit entity Tamed, but it wont follow me.. its like its tamed but not by me, so the entity itself is taming right, the problem is the command; i would do this any other way i could tbh, this was the only way i could find to make the tamed mobs sit rn (mcreator 2023)