Jade ๐Ÿ”

Jade ๐Ÿ”

45M Downloads

Targeting a multipart Entity can be inconsistent due to subparts being hit-detected

Thelnfamous1 opened this issue ยท 1 comments

commented

Mod loader

Forge

Minecraft version

1.20.1

Mod version

11.7.1

Modloader version

Forge 47.1.28

Modpack info

No response

If bug:

  • Can you reproduce this issue with relevant mods only?

If bug: The latest.log file

No response

Issue description

RayTracing#canBeTarget does not ever filter out instances of Forge's PartEntity, so the hit result for a multipart entity may be one of its subparts, and thus not trigger the correct display info as it is not an instance of its parent entity. Even apart from Forge, targeting multipart entities such as the Ender Dragon may be inconsistent as it has EnderDragonParts which can be hit-detected (this multipart system is already integrated with Forge's multipart API). These subparts use the same EntityType as their parent entity, so they cannot be filtered out via the client config either.

In my own Forge mod with Jade compat, I apply an Injection Mixin into RayTracing#canBeTarget for debugging purposes. I have it return false if the entity is an instance of PartEntity. This allows me to consistently look at my multipart entity without hit-detecting the sub-parts.

Perhaps some way to allow mods to provide their own entity ray trace filters would be better than permanently blacklisting all instances of Forge's PartEntity or vanilla's EnderDragonPart. One could imagine a use-case where a mod's entity subpart implementation having its own display info is desired. But a built-in blacklist may be more desirable in most cases.

commented

I plan to always return the main entity, and provide a method to get the part entity in EntityAccessor