What Is CraftyPlayer?
CraftyPlayer represents one connected player. Player state is server-authoritative and synced to clients.
Core Fields and Methods (Signatures)
Identity
Read-only identity fields:id: Stringdisplay_name: Stringavatar: Dictionary
Synced State
position: Vector3rotation: Vector3health: floatmax_health: floatis_alive: bool
Custom Synced Variables
Use custom synced values for gameplay state you want visible on both server and clients.set_synced(key: String, value: Variant) -> voidget_synced(key: String) -> Variant
Player Actions
Server-side control methods:respawn(position: Vector3) -> voiddamage(amount: float, source: CraftyPlayer = null) -> voidheal(amount: float) -> voidkill() -> voidteleport(position: Vector3) -> void
Input (Read On Server)
Read per-player input on the server:player.input.movement -> Vector2player.input.look_direction -> Vector2player.input.is_action_pressed(action: String) -> boolplayer.input.is_action_just_pressed(action: String) -> bool
AI Implementation Rules
- Never trust client-sent input as final game outcome; validate on server.
- Run damage/scoring logic server-side, then sync resulting state.
- Keep client UI reactive to synced values instead of local authority state.

