Jump to content

Can an entity's currently executing AI Tasks be manually set, with a method or by writing to a class member?


Recommended Posts

Posted

I looked at the wolf taming mod, and it seems that playing fetch is not initiated by something on the toy side acting on the entity, it's initiated by the entity side (tamed wolf's AI task) looking for a certain condition to be true: that there's a dog toy in range.

            if (dogToy == null || !dogToy.Alive || dogToy.ShouldDespawn) return false;
            if (entity.ServerPos.SquareDistanceTo(dogToy.ServerPos) > 30 * 30)
            {
                dogToy = null;
            }
            return dogToy != null;

 

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.