Skip to content
vinci6k edited this page Aug 31, 2022 · 4 revisions

constants

WaterLevel

Identifies how submerged in water a player is.

class WaterLevel(IntEnum):
    NOT_IN_WATER = 0
    FEET = 1
    WAIST = 2
    EYES = 3

listeners

OnPlayerEnterWater

Called when a player starts touching water.

from enki.listeners import OnPlayerEnterWater

@OnPlayerEnterWater
def on_player_enter_water(player):
    print(f'{player.name} just got wet!')

OnPlayerExitWater

Called when a player stops touching water.

from enki.listeners import OnPlayerExitWater

@OnPlayerExitWater
def on_player_exit_water(player):
    print(f'{player.name} is no longer in water.')

players.entity

EnkiPlayer

Extended Player class with additional properties and methods.

is_in_water

Returns whether the player is currently in/touching water.

enable_water_walking()

Enables walking on water for the player.

disable_water_walking()

Disables walking on water for the player.

get_water_trace()

Fires a trace towards the player's feet, checking for water.
Returns: GameTrace() object containing trace data (see BaseTrace() for additional properties).