Started by
PheasantKing15
on
Topic category: Help with Minecraft modding (Java Edition)
I would like to edit polar bear and wolf A.I to be more realistic And I want to change the model size for spiders/sliverfish/endermites/cave spiders
Edited by PheasantKing15 on Mon, 08/21/2017 - 19:17
Actually, it does not. Do you want to change its drops? Or AI, model, size, texture, or what? The title says very little to say anything specific.
I would like to edit it's A.I, I want to make polar bears and wolves need to eat and drink and be able to reproduce on their own
You have to first make an Event Handler (I recommend start with "Overlay element" as it already contains one). There you need subscribe for EntityJoinWorldEvent. event. First, check if the entity is an instance of EntityPolarBear or EntityWolf. Next, you can get the tasks field of the entity. Here you can use method addTask() to add a new AI task.
Unfortunately, you have to make one. An AI task must extend EntityAIBase. You can start with EntityAIEatGrass. You can check for example every block in an area of 16 blocks if it is water and if so move the entity to the block, do some "drink effect" and increase its "thirst" variable. For this, you need to use a custom Capability. Capability can seem to be hard to make but in reality, it is quite easy. For the reproduction, you need to use a custom modified version of EntityAIMate so you can check the thirst and hunger.
For model changing RenderingRegistry.registerEntityRenderingHandler() is most likely the way to go.
How to I sub to entityjoinworldevent?
And how to I go to overlay element?
As I said, create an EventHandler (best way to do it is creating a random "Overlay" element). It has already event handler in it. There is already even one event subscribed so you can use it as a reference.
So sorry if I am not getting it, could you give me pictures?