Started by
potatomancer
on
Topic category: Help with Minecraft modding (Java Edition)
i am trying to make a mob that, upon noticing the player or a mob it is hostile to:
- saves its targets position
- waits for 1 second
- moves towards saved position with increased speed and dies when reaching it (mob explodes on death, i already have that part made)
i have no idea on how to change mob behavior beyond the provided task/goals editor, so general information on the tools to do this for the future will be greatly appreciated
Edited by potatomancer on Thu, 10/16/2025 - 00:08
It'd probably be easiest to just use the tick trigger for the entity and then the path find procedure block
i set up the base for the mob behavior (thanks for the tick trigger tip, didnt know that existed) but, despite saving the target position as a local variable, it navigates towards 0, 0, 0 instead of the target coordinates. heres the generated code from my current procedure, please let me know if i am doing something wrong
can you send the procedure as an image instead?
i cant figure out the insert image via url, but i posted it on imgur
https://imgur.com/gallery/mcreator-delayed-explosion-charge-code-5oxY32y
is this null?,
yes, but i dont know what null means. is that why the coordinates arent working? if so, what do i do about it?
it means it couldn't find any entity, and yeah that'd be why
it doesnt make sense why the values will return as 0, there is an if statement assuring that the data is valid and i also tried making the get radius larger than the if radius, and it still doesnt work. please tell me how to stop it from being null
oh have you tested if it even passes that condition?
in mcreator local number variables are set to 0 at the start of the procedure
i know it passes the procedure because if it didnt the entity wouldnt navigate at all, but it does, just not to where i want it to.
oh wait. Local variables are "cleared"/"forgotten" when the execution of the procedure reaches the end of it.
switched the variables to an nbt value and it worked! thanks for your help