genovefa Posted October 30, 2025 Report Posted October 30, 2025 Or is it more like i need to reverse the logic here, and craft a good condition for the ShouldExecute function in the AI task?
genovefa Posted October 30, 2025 Author Report Posted October 30, 2025 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;
Recommended Posts