Started by
MintyJuicey
on
Topic category: Help with Minecraft modding (Java Edition)
im currently making a mod and i want to make it so that a mob can devour you if your half health but also not do that when you have tamed it
Topic category: Help with Minecraft modding (Java Edition)
im currently making a mod and i want to make it so that a mob can devour you if your half health but also not do that when you have tamed it
In the AI, where you're telling it to attack players, add a 'continue condition' that checks if the entity is tamed, and that the entity it's targeting to attack is at half health. (You would do this by checking if the victim's current health is less than or equal to their maximum health divided by two.)
that doesnt seem to work with me well. i need an effect that does exactly in the title because i want this mob to work on mutiplayer so any ideas
In that case you should be able to just check that the entity it's targeting for an attack does not equal the entity who tamed it. You can reference both using the 'get owner' and 'get entity targeted for attack' functions, and then also check that the entity targeted for attack is at half health, using the above method. Again, for this to do anything, it needs to be the continue condition for your entity's attack AI, so you need to make sure it returns 'true' if the conditions are met, and 'false' if they aren't.
any ideas???? guys?
hmmmm maybe i shouldn't do that but like is there a way to detect if an entity has hit someone
Yes. You would use the 'entity attacked' global trigger. This will supply you with the even/target entity, (the entity that was hit), and the source entity. (The entity that performed the attack.)
wait is there a plugin to detect this
You just use global trigger. No need for a plugin
thanks a lot guys
wait how do i detect the target mob is a custom one?
You would use the 'is entity subtype of' function, found in the logic box. You provide it with an entity, and it returns true if that entity is of the given type.