Skip to main content

Module game_mode

Module game_mode 

Source
Expand description

Game mode specific logic for player interactions. Game mode specific logic for player interactions.

This module implements the logic from Javaโ€™s ServerPlayerGameMode, particularly the useItemOn method that handles block placement and block interactions.

Modulesยง

block_breaking
Block breaking state machine for players.
block_interaction ๐Ÿ”’
entity_interaction ๐Ÿ”’
item_interaction ๐Ÿ”’
player_methods ๐Ÿ”’
raycast ๐Ÿ”’

Structsยง

PlayerGameModeState ๐Ÿ”’
Current and previous player game mode stored as one coherent state.

Constantsยง

ATTACK_RANGE_BUFFER ๐Ÿ”’
CREATIVE_BLOCK_RANGE_MODIFIER_AMOUNT ๐Ÿ”’
CREATIVE_ENTITY_RANGE_MODIFIER_AMOUNT ๐Ÿ”’
ENTITY_INTERACTION_RANGE_BUFFER ๐Ÿ”’
FLIGHT_DISABLE_RANGE ๐Ÿ”’

Functionsยง

use_item
Handles using an item (general usage like right-clicking air).
use_item_on
Handles using an item on a block.