Class ComputeFovModifierEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ComputeFovModifierEvent

public class ComputeFovModifierEvent extends net.neoforged.bus.api.Event
Fired after the field of vision (FOV) modifier for the player is calculated to allow developers to adjust it further.

This event is not

invalid reference
cancellable
, and does not
invalid reference
have a result
.

This event is fired on the main Forge event bus, only on the logical client.

See Also:
  • Field Details

    • player

      private final Player player
    • fovModifier

      private final float fovModifier
    • newFovModifier

      private float newFovModifier
  • Constructor Details

    • ComputeFovModifierEvent

      @Internal public ComputeFovModifierEvent(Player player, float fovModifier)
  • Method Details

    • getPlayer

      public Player getPlayer()
      Returns the player affected by this event.
      Returns:
      the player affected by this event
    • getFovModifier

      public float getFovModifier()
      Returns the original field of vision (FOV) of the player, before any modifications or interpolation.
      Returns:
      the original field of vision (FOV) of the player, before any modifications or interpolation
    • getNewFovModifier

      public float getNewFovModifier()
      Returns the current field of vision (FOV) of the player.
      Returns:
      the current field of vision (FOV) of the player
    • setNewFovModifier

      public void setNewFovModifier(float newFovModifier)
      Sets the new field of vision (FOV) of the player.
      Parameters:
      newFovModifier - the new field of vision (FOV)