Class ComputeFovModifierEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.ComputeFovModifierEvent

public class ComputeFovModifierEvent extends net.minecraftforge.eventbus.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 cancellable, and does not have a result.

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

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final float
     
    private float
     
    private final Player
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComputeFovModifierEvent(Player player, float fovModifier)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the original field of vision (FOV) of the player, before any modifications or interpolation.
    float
    Returns the current field of vision (FOV) of the player.
    Returns the player affected by this event.
    void
    setNewFovModifier(float newFovModifier)
    Sets the new field of vision (FOV) of the player.

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)