Started by
jejak.
on
Topic category: Help with Minecraft modding (Java Edition)
for example, a wild sheep will not drop anything, but when you feed it a food it turns into a regular sheep and it is possible to get wool and mutton by killing it
Right clicked on entity, get item in main hand is tagged as food, make a custom tag and add all food you want, then if so despawn entity and spawn entity at the same x y z, also set rotation and pitch to the original entities same values to make it seemless
To replace it, you can do on entity tick update, check entity is type sheep, despawn entity, spawn wild sheep, etc as above but the other way around
Basically what fr6_17 said but using a tamable mob for easier implementation:
AI and goals: make the entity an animal type and make sure to add your foods and the ability for your entity to be tamed.
Triggers: [On entity tick update] use our tick procedure.
For the tick procedure, just follow the image instructions:
You may omit the yaw, pitch, vx, vy, and vz, but the results will be less smooth.
Here's a procedure I made for replacing spawned mobs into their wild counterparts:
You may omit the yaw, pitch, vx, vy, and vz, but the results will be less smooth.
You can also just duplicate this to work for other mobs. If you choose to do so, you can have all of them work inside of the same procedure.