Advanced customization of mob data and behavior(?)

Hello,

I was reading through the API documentation and am loving the design decisions thus far.

I just read about spawning entities and how to modify an entities data.

Will it be possible to modify an entities behavior? Such as altering the attack types. My use case is a custom mob plugin I am working on that will add two attack types and additional modifiers to entities/monsters.

An attack type could be just the default behavior or with a % chance shooting a fireball or something unique. It would be really nice to be able to hook into the entity behavior and alter it at entity creation. That way I could override the behavior to customize it … some of the time.

The current way I do this in bukkit is through events. This works fine, but it would be a much cleaner implementation to have all the different behaviors defined and then tweak them based on the custom behaviors I want to support.

I think if we have hooks into the behavior/AI of an entity would pave the way for more advanced customization such as altering the AI of a pig to make it a death pig… for example.

Anyways, was curious if this was planned or if this already exists in the API already!

Edit:
Also, here is the entity spawning documentation I was referring to: https://docs.spongepowered.org/en/plugin/basics/entities/spawning.html

Modifying AI is something that we’re eventually planning on providing in the API. The issue can be viewed here.

Also, due to the recent Data API changes, I’ve updated the docs on spawning entities as the code is much more simplified now. With regards to what you want to do, the closest thing I can suggest to do is either use a scheduled task for each entity to mimic

2 Likes

Thanks for the reply. I look forward to the AI API and understand the need for using a scheduled task. Do you think with the future AI API there will be a way to only capture the moment an entity is about to attack and then alter that ability?