The Twilight Forest

The Twilight Forest

140M Downloads

[Suggestion] Forge event before Seeker Arrow targeting entity, for compatibility

SodiumZH opened this issue ยท 2 comments

commented

The Suggestion

Adding a cancelable Forge event before Seeker Arrow setting target to a living entity, so that other modders can make additional checks and actions for whether it should target an entity.
If this feature is acceptable, I'll try to implement and create pull request for it.

Why Should It Be in the Mod?

Currently the rules for Seekers Arrow seeking target is fully hard-coded, and the arrow will inevitably target all mobs extending Monster class no matter if they're really designed as enemies. Sometimes other modders may not expect the arrow to target certain mobs in their mods.
For example, I'm currently making a mod for taming existing mobs into friendly ones, most of which extend Monster class, and found the incompatibility that Seeker Arrows target the tamed mobs instead of the mobs players really want to attack.

Please Read and Confirm the Following

  • I have confirmed this suggestion is unique and has not been suggested already.
commented

Honestly a great idea, if you want make an event for it go right ahead, otherwise i can add it when i get some time. Instead of making it cancelable I would make it use an event result (allow, default, deny) so people can also make it prioritize non-monsters if they wish.

commented

Honestly a great idea, if you want make an event for it go right ahead, otherwise i can add it when i get some time. Instead of making it cancelable I would make it use an event result (allow, default, deny) so people can also make it prioritize non-monsters if they wish.

As my recent idea, would it be better to check if a mob is an enemy by finding if it has a NearestAttackableTarget<Player> or NearestAttackableTarget<ServerPlayer> TargetGoal instead of by checking if it inherits Monster class? In my mod I use the latter to check if a mob is really an enemy.