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).
Event Class
Link to event-class
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:
ZenGetter | ZenSetter | Type |
---|---|---|
ZenGetter visibility | ZenSetter | Type double |
ZenGetter | ZenSetter modifyVisibility | Type See note. |
Note
Link to note
This value cannot be directly set. Calling modifyVisibility
with a double value will replace the modifier with the result of modifiy * double value
.