Crendgrim / DynamicCrosshair

A Minecraft mod that hides or changes the crosshair dependent on context.
GNU Lesser General Public License v3.0
21 stars 6 forks source link

Crosshair shows invisible entities #100

Open xllifi opened 1 month ago

xllifi commented 1 month ago

Reproduction:

  1. Create an invisible entity (/summon cow ~ ~ ~ {active_effects:[{id:"minecraft:invisibility",amplifier:1,duration:9999}]})
  2. Hover over the entity

Screenshots: Image showing crosshair in Survival mode Image showing crosshair in Survival mode Image showing entity in Spectator mode Image showing entity in Spectator mode

Crendgrim commented 1 month ago

Oh that is interesting. I am not sure whether this is a bug or a feature. I'm assuming it can cause issues on servers or maps that use invisible entities for some interaction trickery?

In vanilla, if you encounter e.g. a spider with an invisibility potion effect, it will still be visible through its eyes + particle effects. And I would expect the crosshair to still work like usual. I found the crosshair to be quite useful in interacting with wandering traders at night too. I believe that is all naturally occurring cases of invisibility, so that is all the cases I had considered.

Would "ignore invisible entities that suppress particle effects" be the right choice? That would create a new problem: assume there is a crafting table behind that invisible entity. Should the crosshair show the interaction for the crafting table or a regular crosshair? Either way has drawbacks.

xllifi commented 1 month ago

Would "ignore invisible entities that suppress particle effects" be the right choice? That would create a new problem: assume there is a crafting table behind that invisible entity. Should the crosshair show the interaction for the crafting table or a regular crosshair? Either way has drawbacks.

I think yes. It should show entity crosshair for entities with particles and don't show any special crosshair when there's a fully invisible entity in the way. I think this would be the best solution because a crosshair should not provide misinformation.

OFC, both of those rules should ignore interaction entity (as in "should show interaction crosshair")

Also maybe make it optional to always/never show invisible entities? And maybe even allow to change this setting server-side. IDK how you're gonna do that though, maybe via permissions (LuckPerms and/or OP level), so this mod is not required server-side (usable for Bukkit/Spigot/Paper servers)