Class CalculateDetachedCameraDistanceEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.CalculateDetachedCameraDistanceEvent
public class CalculateDetachedCameraDistanceEvent
extends net.neoforged.bus.api.Event
Fired for hooking the maximum distance from the player to the camera in third-person view.
 The ray-cast that reduces this distance based on the blocks around the player is invoked after this event is fired.
 
This event is not cancellable, and does not 
.invalid reference
have a result
This event is fired on the main Forge event bus, only on the logical client.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final Cameraprivate final booleanprivate doubleprivate final float
- 
Constructor SummaryConstructorsConstructorDescriptionCalculateDetachedCameraDistanceEvent(Camera camera, boolean cameraFlipped, float entityScale, double distance) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the camera instance.doubleReturns the pre-scaling factor distance from the camera to the camera entity.floatReturns the scaling factor that will be applied to the final distance, based on the size of thecamera entity.booleanReturns `true` if the camera is flipped (ie facing backward instead of forward).voidsetDistance(double distance) Sets the pre-scaling factor distance from the camera to the camera entity.
- 
Field Details- 
camera
- 
cameraFlippedprivate final boolean cameraFlipped
- 
entityScaleprivate final float entityScale
- 
distanceprivate double distance
 
- 
- 
Constructor Details- 
CalculateDetachedCameraDistanceEvent@Internal public CalculateDetachedCameraDistanceEvent(Camera camera, boolean cameraFlipped, float entityScale, double distance) 
 
- 
- 
Method Details- 
getCameraReturns the camera instance.
- 
isCameraFlippedpublic boolean isCameraFlipped()Returns `true` if the camera is flipped (ie facing backward instead of forward).
- 
getEntityScalingFactorpublic float getEntityScalingFactor()Returns the scaling factor that will be applied to the final distance, based on the size of thecamera entity.
- 
getDistancepublic double getDistance()Returns the pre-scaling factor distance from the camera to the camera entity.
- 
setDistancepublic void setDistance(double distance) Sets the pre-scaling factor distance from the camera to the camera entity.- Parameters:
- distance- The new distance from the camera to the camera entity
 
 
-