PlayerVisibility

Link to playervisibility

This event is fired to determine the visibility of a player, i.e., whether or not they are close enough to be noticed by an attacker. The result of this event is used to calculate (with modifiers from Vanilla Minecraft for sneaking, etc) the range a player can get to a creature before that creature sees them.

While this can be used to increase the visibility range (if it were decreased by Minecraft or another mod), it cannot be increased above its maximum value (the standard target distance).

You will need to cast the event in the function header as this class:
crafttweaker.event.PlayerVisibilityEvent
You can, of course, also import the class before and use that name then.

Event interface extensions

Link to event-interface-extensions

PlayerVisibilityEvent Events implement the following interfaces and are able to call all of their methods/getters/setters as well:

ZenGetters/ZenSetters

Link to zengetterszensetters

The following information can be retrieved/set during the event:

ZenGetterZenSettersType
ZenGetter
modifier
ZenSetters
Type
double

event.modifyVisibility(double value) -> This value cannot be directly set. Calling modifyVisibility with a double value will replace the modifier with the result of modifier * double value.

ZenGetters/ZenSetters/ZenMethods from extensions

Link to zengetterszensetterszenmethods-from-extensions

The following information can be retrieved/set during the event:

ZenGetterZenSetterType
ZenGetter
player
ZenSetter
Type
IPlayer

From extension of extension

Link to from-extension-of-extension

ZenGetterZenSetterType
ZenGetter
entityLivingBase
ZenSetter
Type
IEntityLivingBase