Started by
jupop777
on
Topic category: Help with Minecraft modding (Java Edition)
I dunno how to put images in here so ill try my best to explain. I need a non-vanilla mob to move from anywhere on the the map to a certain place (for instance, if I was building an rpg type game I need an npc to move to a certain area without teleporting so that the players could follow it). I also need the mob to be able to move around normally after it reaches this area, so that the npc can run from the evil characters in the rpg. TIA
help
you need to modify the entity's AI. mcreator can't do what you want with the preset AI options. some coding is required.
Ok, I have some java experience, but do you have anything I can start with?
your entity has to be a Mob or Creature.
once you've setup everything else with your entity's properties, lock your entity's code.
goto your entity's source code and find an appropriate place to put in this.setHomePosAndDistance passing it your target location BlockPos and radius.
in the place where you entity's AI functions are set, add EntityAIMoveTowardsRestriction AI task in the appropriate priority. the first parameter is "this", the second is the speed.
you're gonna have to mess around where to put those to get it working right. code on brother!