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 Summary

    Fields
    Modifier and Type
    Field
    Description
    private final float
     
    private final float
     
    private float
     
    private final net.minecraft.world.entity.player.Player
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ComputeFovModifierEvent(net.minecraft.world.entity.player.Player player, float fovModifier, float fovScale)
     
  • 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 FOV scale to use for interpolating the final FOV modifier.
    float
    Returns the current field of vision (FOV) of the player.
    net.minecraft.world.entity.player.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 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • player

      private final net.minecraft.world.entity.player.Player player
    • fovModifier

      private final float fovModifier
    • fovScale

      private final float fovScale
    • newFovModifier

      private float newFovModifier
  • Constructor Details

    • ComputeFovModifierEvent

      @Internal public ComputeFovModifierEvent(net.minecraft.world.entity.player.Player player, float fovModifier, float fovScale)
  • Method Details

    • getPlayer

      public net.minecraft.world.entity.player.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
    • getFovScale

      public float getFovScale()
      Returns the FOV scale to use for interpolating the final FOV modifier.
      Returns:
      the FOV scale to use for interpolating the final FOV modifier
    • 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)