Started by
ninjawizard1234
on
Topic category: Help with Minecraft modding (Java Edition)
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!
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.
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)
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!
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.
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 :)
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?
'
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)