Skip to content

Client

Section notes in abi.h

Capability group: client (client_*). All NULL on a server host.

Two capability groups follow, client and dimensions. They are unconditionally present in the layout; when the capability package was not built into the host, their slots are NULL (see the file header). New slots still go at the real end of the struct, never inside a capability group.

Every callback fires on the client thread.

Client capability group, continued. NULL on a server host, like client_* above;

these sit here because a slot only ever goes at the end. Client thread only.

Client capability group, options. NULL on a server host. Client thread only. An

option is addressed by the key options.txt stores it under, and its value travels in the text form options.txt holds. The engine declares no names for OptionID, so each call walks the ids the registry reports valid.

Slots

client_get_local_player

C
bool (*client_get_local_player)(void* ctx, PierStrSink sink);

Local player's name via ll::service::getClientInstance()->getLocalPlayer(). sink receives the name, or the call returns false if not in a level.

client_is_in_level

C
bool (*client_is_in_level)(void);

True when the client is inside a level (a world is loaded).

client_get_screen_name

C
bool (*client_get_screen_name)(void* ctx, PierStrSink sink);

Current screen name through IClientInstance::getScreenName, such as "hud_screen" or "pause_screen". Returns false, sinking nothing, before the client has an instance. PIER_CSTR_TOP_SCREEN_NAME of client_get_str reads the topmost screen of the stack instead.

  • Call: api->client_get_screen_name(ctx, sink)
  • Parameters:
    • ctx : void*
    • sink : PierStrSink
  • Return type: bool
  • Section of abi.h: Capability group: client (client_*). All NULL on a server host.
  • Position in the table: slot 142, counting from 0
  • Callers in each binding:

client_register_key

C
PierKeyHandle (*client_register_key)(
    PierModHandle mod,
    PierStr name,
    int32_t const* key_codes,
    int32_t key_count,
    bool allow_remap,
    PierKeyCb down_cb,
    PierKeyCb up_cb,
    void* user
);

Register a key binding via ll::input::KeyRegistry::getOrCreateKey. Returns NULL on failure. The handle is owned by the caller; drop with client_unregister_key. down_cb/up_cb fire on the client thread.

  • Call: api->client_register_key(mod, name, key_codes, key_count, allow_remap, down_cb, up_cb, user)
  • Parameters:
    • mod : PierModHandle
    • name : PierStr
    • key_codes : int32_t const*
    • key_count : int32_t
    • allow_remap : bool
    • down_cb : PierKeyCb
    • up_cb : PierKeyCb
    • user : void*
  • Return type: PierKeyHandle
  • Section of abi.h: Capability group: client (client_*). All NULL on a server host.
  • Position in the table: slot 143, counting from 0
  • Callers in each binding:

client_unregister_key

C
bool (*client_unregister_key)(PierKeyHandle handle);

Unregister a key binding: this mod's handler stops firing and the handle is freed. The ll::input::KeyHandle itself is not destroyed, since the key registry keeps one key per name and offers no removal; registering the same name again reuses that key.

client_get_key_codes

C
bool (*client_get_key_codes)(PierKeyHandle handle, void* ctx, PierStrSink sink);

Currently assigned key codes (may differ from defaults if remapped). sink receives a JSON-style array string "[1,2,3]".

client_get_num

C
bool (*client_get_num)(int32_t prop, double* out);

Reads one PIER_CPROP_* value into *out. Returns false, leaving *out alone, for an unknown key, a null out, a client that has no instance yet, or a key about the local player while the client is not in a world. A flag reads 1 or 0.

client_get_str

C
bool (*client_get_str)(int32_t prop, void* ctx, PierStrSink sink);

Reads one PIER_CSTR_* value through sink, called once. Returns false, sinking nothing, for an unknown key, a null sink, or a client that has no instance yet.

client_action

C
bool (*client_action)(int32_t action, PierStr sarg, double a, double b, double c);

Performs one PIER_CACT_* verb on this client. Returns false for an unknown verb, a text verb given empty text, or a client that has no instance yet. The text verbs need the HUD, which exists once a world is loaded, and return false before that. True means the call reached the engine, which reports nothing back.

client_list_keys

C
bool (*client_list_keys)(void* ctx, PierStrSink sink);

Feeds the name of every binding ll::input::KeyRegistry holds to sink, one call each, whichever mod registered it. Returns false only for a null sink.

client_option_list

C
bool (*client_option_list)(void* ctx, PierKvSink sink);

Feeds every option to sink, one (key, value) pair each, as Option::save writes them. An option that stores several keys, such as one value per input mode, feeds each. Returns false for a null sink or a client that has no instance yet.

  • Call: api->client_option_list(ctx, sink)
  • Parameters:
    • ctx : void*
    • sink : PierKvSink
  • Return type: bool
  • Section of abi.h: Client capability group, options. NULL on a server host. Client thread only. An
  • Position in the table: slot 217, counting from 0
  • Callers in each binding:

client_option_get

C
bool (*client_option_get)(PierStr key, void* ctx, PierStrSink sink);

Reads one option by its options.txt key through sink, called once. Returns false, sinking nothing, for an unknown key, a null sink, or a client that has no instance yet.

  • Call: api->client_option_get(key, ctx, sink)
  • Parameters:
    • key : PierStr
    • ctx : void*
    • sink : PierStrSink
  • Return type: bool
  • Section of abi.h: Client capability group, options. NULL on a server host. Client thread only. An
  • Position in the table: slot 218, counting from 0
  • Callers in each binding:

client_option_set

C
bool (*client_option_set)(PierStr key, PierStr value);

Writes the option that stores key, passing value to Option::load, the parser options.txt is read with. Returns false for an unknown key or a client that has no instance yet. Option::canModify has no client export, so the setter cannot check whether an option is locked. The engine keeps what it can parse and reports nothing, so a caller that needs to know reads the key back. The host does not write options.txt.

  • Call: api->client_option_set(key, value)
  • Parameters:
    • key : PierStr
    • value : PierStr
  • Return type: bool
  • Section of abi.h: Client capability group, options. NULL on a server host. Client thread only. An
  • Position in the table: slot 219, counting from 0
  • Callers in each binding:

Types

PierKeyHandle

C
typedef void* PierKeyHandle;

Opaque handle to a registered key binding owned by the loader's ll::input::KeyRegistry. Drop via client_unregister_key.

PierKeyAction

C
typedef int32_t PierKeyAction;

Key action: 0 = released (up), 1 = pressed (down). Mirrors ll::event::KeyInputEvent::Action.

PierFocusImpact

C
typedef int32_t PierFocusImpact;

Focus impact level: 0=Neutral 1=ActivateFocus 2=DeactivateFocus. Mirrors ::FocusImpact.

PierKeyCb

C
typedef void (*PierKeyCb)(void* user, PierKeyAction action, PierFocusImpact impact);

Callback for key press/release events. Runs on the client thread. user β€” pointer passed to client_register_key action β€” 0=released 1=pressed (see PierKeyAction) impact β€” current focus impact (see PierFocusImpact)

PierClientNumProp

client_get_num keys. Each value is read from this client's own state, so on a remote server it describes what this client sees. APPEND-ONLY, like every key enumeration in this file; an unknown key makes the call return false. Keys 0 to 5 and 13 to 27 read the local player and fail while the client is not in a world.

Name Value Description
PIER_CPROP_POS_X 0 Actor::getFeetPos of the local player
PIER_CPROP_POS_Y 1 feet height, the same point get_player_position reports
PIER_CPROP_POS_Z 2
PIER_CPROP_PITCH 3 Actor::getRotation, degrees; negative looks up
PIER_CPROP_YAW 4 Actor::getRotation, degrees
PIER_CPROP_DIMENSION 5 Actor::getDimensionId of the local player
PIER_CPROP_GUI_SCALE 6 IClientInstance::getGuiScale
PIER_CPROP_SERVER_PING_MS 7 IClientInstance::getServerPingTime
PIER_CPROP_IS_SHOWING_MENU 8 IClientInstance::isShowingMenu, 1 or 0
PIER_CPROP_IS_SHOWING_PAUSE_SCREEN 9 IClientInstance::isShowingPauseScreen
PIER_CPROP_IS_PLAYING 10 IClientInstance::isPlaying
PIER_CPROP_IS_IN_REALM 11 IClientInstance::isInRealm
PIER_CPROP_IS_GAME_INPUT_ENABLED 12 IClientInstance::isInGameInputEnabled
PIER_CPROP_HEALTH 13 Actor::getHealth of the local player
PIER_CPROP_MAX_HEALTH 14 Actor::getMaxHealth of the local player
PIER_CPROP_IS_ON_GROUND 15 Actor::isOnGround of the local player
PIER_CPROP_IS_IN_WATER 16 Actor::isInWater of the local player
PIER_CPROP_IS_SNEAKING 17 Actor::isSneaking of the local player
PIER_CPROP_IS_SPRINTING 18 Actor::isSprinting of the local player
PIER_CPROP_IS_SWIMMING 19 Actor::isSwimming of the local player
PIER_CPROP_IS_ON_FIRE 20 Actor::isOnFire of the local player
PIER_CPROP_IS_FLYING 21 Player::isFlying of the local player
PIER_CPROP_GAME_TYPE 22 Player::getPlayerGameType of the local player
PIER_CPROP_SELECTED_SLOT 23 Player::getSelectedItemSlot of the local player
PIER_CPROP_VEL_X 24 Actor::getPosDelta of the local player, blocks per tick
PIER_CPROP_VEL_Y 25 Actor::getPosDelta, the vertical part
PIER_CPROP_VEL_Z 26 Actor::getPosDelta, the z part
PIER_CPROP_XP_NEEDED_NEXT_LEVEL 27 Player::getXpNeededForNextLevel of the local player
PIER_CPROP_IS_LEAVING_GAME 28 IClientInstance::isLeavingGame
PIER_CPROP_IS_EXITING_LEVEL 29 IClientInstance::isExitingLevel
PIER_CPROP_IS_IN_BED_SCREEN 30 IClientInstance::isInBedScreen
PIER_CPROP_IS_IN_DEATH_SCREEN 31 IClientInstance::isInDeathScreen
PIER_CPROP_IS_SHOWING_LOADING_SCREEN 32 IClientInstance::isShowingLoadingScreen
PIER_CPROP_IS_SHOWING_PROGRESS_SCREEN 33 IClientInstance::isShowingProgressScreen
PIER_CPROP_IS_SHOWING_WORLD_PROGRESS_SCREEN 34 IClientInstance::isShowingWorldProgressScreen
PIER_CPROP_IS_SHOWING_DEATH_SCREEN 35 IClientInstance::isShowingDeathScreen
PIER_CPROP_IS_SHOWING_SERVER_FORM 36 IClientInstance::isShowingServerForm
PIER_CPROP_IS_IN_WORLD_WITHOUT_MENU 37 IClientInstance::isInWorldAndNotShowingAnyMenuScreens
PIER_CPROP_IS_WORLD_ACTIVE 38 IClientInstance::isWorldActive
PIER_CPROP_HAS_LEVEL 39 IClientInstance::hasLevel
PIER_CPROP_IS_PRE_GAME 40 IClientInstance::isPreGame
PIER_CPROP_IS_IN_MULTIPLAYER_GAME 41 IClientInstance::isInMultiplayerGame
PIER_CPROP_IS_MULTIPLAYER_CLIENT 42 IClientInstance::isMultiPlayerClient
PIER_CPROP_IS_PRIMARY_LEVEL_MULTIPLAYER 43 IClientInstance::isPrimaryLevelMultiplayer
PIER_CPROP_IS_PRIMARY_LEVEL_CROSS_PLATFORM 44 IClientInstance::isPrimaryLevelCrossPlatformMultiplayer
PIER_CPROP_IS_KEYBOARD_ENABLED 45 IClientInstance::isKeyboardEnabled
PIER_CPROP_IS_USING_CONTROLLER 46 IClientInstance::useController
PIER_CPROP_IS_USING_TOUCHSCREEN 47 IClientInstance::useTouchscreen
PIER_CPROP_IS_MOUSE_GRABBED 48 IClientInstance::getMouseGrabbed
PIER_CPROP_IS_MOUSE_AND_KEYBOARD 49 IClientInstance::currentInputModeIsMouseAndKeyboard
PIER_CPROP_HAS_CONNECTED_CONTROLLER 50 IClientInstance::hasConnectedController
PIER_CPROP_CONTROLLER_ID 51 IClientInstance::getControllerId
PIER_CPROP_IS_TOUCH_GAMEPLAY_ALLOWED 52 IClientInstance::isTouchGameplayAllowed
PIER_CPROP_IS_SPLIT_SCREEN_ACTIVE 53 IClientInstance::isSplitScreenActive
PIER_CPROP_SPLIT_SCREEN_COUNT 54 IClientInstance::getSplitScreenCount
PIER_CPROP_GUI_SCALE_OFFSET 55 IClientInstance::getGuiScaleOffset
PIER_CPROP_IS_EDU_MODE 56 IClientInstance::isEduMode
PIER_CPROP_IS_IN_EDITOR 57 IClientInstance::isPlayerInEditor
PIER_CPROP_IS_READY_TO_RENDER 58 IClientInstance::isReadyToRender
PIER_CPROP_IS_FULL_VANILLA_PACK_ON_STACK 59 IClientInstance::isFullVanillaPackOnStack
PIER_CPROP_SERVER_CONNECTION_TIME 60 IClientInstance::getServerConnectionTime
PIER_CPROP_REMOTE_SERVER_TIME_MS 61 IClientInstance::getRemoteServerTimeMs
PIER_CPROP_REMOTE_SERVER_NETWORK_TIME_MS 62 IClientInstance::getRemoteServerNetworkTimeMs
PIER_CPROP_FRAME_ALPHA 63 IClientInstance::getFrameAlpha, how far the frame is between two ticks
PIER_CPROP_GAME_UPDATE_SECONDS 64 IClientInstance::getGameUpdateDurationInSeconds
PIER_CPROP_IS_PRIMARY_CLIENT 65 IClientInstance::isPrimaryClient
PIER_CPROP_USER_ID 66 IClientInstance::getUserId
PIER_CPROP_IS_GAMEPLAY_TIPS_ENABLED 67 IClientInstance::isGamePlayTipsEnabled
PIER_CPROP_HAS_COMMANDS 68 IClientInstance::hasCommands

PierClientStrProp

client_get_str keys.

Name Value Description
PIER_CSTR_SCREEN_NAME 0 IClientInstance::getScreenName, as client_get_screen_name
PIER_CSTR_TOP_SCREEN_NAME 1 IClientInstance::getTopScreenName
PIER_CSTR_PLATFORM_ID 2 IClientInstance::getPlatformId
PIER_CSTR_PLATFORM_ONLINE_ID 3 IClientInstance::getPlatformOnlineId
PIER_CSTR_LOCAL_XUID 4 Player::getXuid of the local player; fails outside a world
PIER_CSTR_LOCAL_UUID 5 Player::getUuid of the local player in its canonical form
PIER_CSTR_LOCAL_NAME_TAG 6 Actor::getNameTag of the local player
PIER_CSTR_CLIPBOARD 7 AppPlatform::getClipboardText, the system clipboard

PierClientAction

client_action verbs. Args are (sarg, a, b, c); unused args are ignored. The text verbs write to this client's HUD only and send nothing to a server.

Name Value Description
PIER_CACT_SHOW_MESSAGE 0 sarg: text. GuiData::displayClientMessage
PIER_CACT_SET_TITLE 1 sarg: text. GuiData::setTitle is not exported by the client target.
PIER_CACT_SET_SUBTITLE 2 sarg: text. GuiData::setSubtitle is not exported by the client target.
PIER_CACT_SET_ACTION_BAR 3 sarg: text. GuiData::setActionBarMessage
PIER_CACT_SHOW_TIP 4 sarg: text. GuiData::showTipMessage is not exported by the client target.
PIER_CACT_PLAY_UI_SOUND 5 sarg: sound name, a: volume, b: pitch. IClientInstance::playUI
PIER_CACT_GRAB_MOUSE 6 IClientInstance::grabMouse
PIER_CACT_RELEASE_MOUSE 7 IClientInstance::releaseMouse
PIER_CACT_SET_INPUT_DISABLED 8 a: non-zero disables game input. IClientInstance::setDisableInput
PIER_CACT_LEAVE_LEVEL 9 IClientInstance::requestLeaveGame(true, false): leaves the world for the menus, asynchronously
PIER_CACT_SHOW_POPUP 10 sarg: message, optionally followed by subtitle after a newline. GuiData::showPopupNotice is not exported by the client target.
PIER_CACT_SHOW_DEV_CONSOLE_MESSAGE 11 sarg: text. GuiData::displayDevConsoleMessage is not exported by the client target.
PIER_CACT_SET_SUSPEND_INPUT 12 a: non-zero suspends input. IClientInstance::setSuspendInput
PIER_CACT_SET_SUSPEND_DIRECTIONAL_INPUT 13 a: non-zero suspends movement input. IClientInstance::setSuspendDirectionalInput
PIER_CACT_SET_GAME_INPUT_ENABLED 14 a: non-zero enables. IClientInstance::setInGameInputEnabled
PIER_CACT_REFOCUS_MOUSE 15 a: non-zero when the mouse was lost. IClientInstance::refocusMouse
PIER_CACT_MUTE_AUDIO 16 IClientInstance::muteAudio
PIER_CACT_UNMUTE_AUDIO 17 IClientInstance::unMuteAudio
PIER_CACT_FADE_OUT_MUSIC 18 IClientInstance::fadeOutMusic
PIER_CACT_SET_GUI_SCALE_OFFSET 19 a: the offset. IClientInstance::setGuiScaleOffset
PIER_CACT_RESET_PLAYER_MOVEMENT 20 IClientInstance::resetPlayerMovement
PIER_CACT_PUSH_LEAVE_GAME_SCREEN 21 IClientInstance::tryPushLeaveGameScreen
PIER_CACT_OPEN_CONTENT_LOG_HISTORY 22 IClientInstance::openContentLogHistory
PIER_CACT_SET_CLIPBOARD 23 sarg: text, empty allowed. AppPlatform::setClipboard
PIER_CACT_NAVIGATE_HOW_TO_PLAY 24 sarg: the topic, empty allowed. IClientInstance::navigateToHowToPlayScreen