Skip to content

Zig: Players

Player

Zig
1
2
3
4
5
pub const Player = struct {
    sel_kind: SelKind,
    sel_value: []const u8,
    // ...
};

One player, named by a selector.

Player.byName

Zig
pub fn byName(sel_name: []const u8) Player
  • Parameters:
    • sel_name : []const u8
  • Return type: Player

Player.byXuid

Zig
pub fn byXuid(sel_xuid: []const u8) Player
  • Parameters:
    • sel_xuid : []const u8
  • Return type: Player

Player.byUuid

Zig
pub fn byUuid(sel_uuid: []const u8) Player
  • Parameters:
    • sel_uuid : []const u8
  • Return type: Player

Player.cSel

Zig
pub fn cSel(self: Player) core.c.PierPlayerSel
  • Return type: core.c.PierPlayerSel

Player.executeCommand

Zig
pub fn executeCommand(self: Player, cmd: []const u8) core.Error!void

Runs cmd as this player, with the player's own permission level. Server thread only. The output lines are logged at debug level; a false from the host, a player who is offline or a level that is not ready, is Refused.

Player.gameType

Zig
pub fn gameType(self: Player) core.Error!f64

PIER_PPROP_GAME_TYPE: (G) Player::getPlayerGameType; write via player_set_gamemode

Player.level

Zig
pub fn level(self: Player) core.Error!f64

PIER_PPROP_LEVEL: (S) attribute Player::LEVEL()

Player.setLevel

Zig
pub fn setLevel(self: Player, new_value: f64) core.Error!void

Writes PIER_PPROP_LEVEL: (S) attribute Player::LEVEL()

  • Parameters:
    • new_value : f64
  • Return type: core.Error!void
  • Slots: player_set_num

Player.experience

Zig
pub fn experience(self: Player) core.Error!f64

PIER_PPROP_EXPERIENCE: (S) attribute Player::EXPERIENCE() (progress 0..1)

Player.setExperience

Zig
pub fn setExperience(self: Player, new_value: f64) core.Error!void

Writes PIER_PPROP_EXPERIENCE: (S) attribute Player::EXPERIENCE() (progress 0..1)

  • Parameters:
    • new_value : f64
  • Return type: core.Error!void
  • Slots: player_set_num

Player.hunger

Zig
pub fn hunger(self: Player) core.Error!f64

PIER_PPROP_HUNGER: (S) attribute Player::HUNGER()

Player.setHunger

Zig
pub fn setHunger(self: Player, new_value: f64) core.Error!void

Writes PIER_PPROP_HUNGER: (S) attribute Player::HUNGER()

  • Parameters:
    • new_value : f64
  • Return type: core.Error!void
  • Slots: player_set_num

Player.saturation

Zig
pub fn saturation(self: Player) core.Error!f64

PIER_PPROP_SATURATION: (S) attribute Player::SATURATION()

Player.setSaturation

Zig
pub fn setSaturation(self: Player, new_value: f64) core.Error!void

Writes PIER_PPROP_SATURATION: (S) attribute Player::SATURATION()

  • Parameters:
    • new_value : f64
  • Return type: core.Error!void
  • Slots: player_set_num

Player.exhaustion

Zig
pub fn exhaustion(self: Player) core.Error!f64

PIER_PPROP_EXHAUSTION: (S) attribute Player::EXHAUSTION()

Player.setExhaustion

Zig
pub fn setExhaustion(self: Player, new_value: f64) core.Error!void

Writes PIER_PPROP_EXHAUSTION: (S) attribute Player::EXHAUSTION()

  • Parameters:
    • new_value : f64
  • Return type: core.Error!void
  • Slots: player_set_num

Player.xpNeededNextLevel

Zig
pub fn xpNeededNextLevel(self: Player) core.Error!f64

PIER_PPROP_XP_NEEDED_NEXT_LEVEL: (G) Player::getXpNeededForNextLevel

Player.luck

Zig
pub fn luck(self: Player) core.Error!f64

PIER_PPROP_LUCK: (G) Player::getLuck

Player.selectedSlot

Zig
pub fn selectedSlot(self: Player) core.Error!f64

PIER_PPROP_SELECTED_SLOT: (G) Player::getSelectedItemSlot; set via PIER_PACT_SET_SELECTED_SLOT

Player.isOperator

Zig
pub fn isOperator(self: Player) core.Error!bool

PIER_PPROP_IS_OPERATOR: (G) Player::isOperator

Player.canUseOperatorBlocks

Zig
pub fn canUseOperatorBlocks(self: Player) core.Error!bool

PIER_PPROP_CAN_USE_OPERATOR_BLOCKS: (G) Player::canUseOperatorBlocks

Player.isFlying

Zig
pub fn isFlying(self: Player) core.Error!bool

PIER_PPROP_IS_FLYING: (G) Player::isFlying

Player.canJump

Zig
pub fn canJump(self: Player) core.Error!bool

PIER_PPROP_CAN_JUMP: (G) Player::canJump

Player.isEmoting

Zig
pub fn isEmoting(self: Player) core.Error!bool

PIER_PPROP_IS_EMOTING: (G) Player::isEmoting

Player.isInRaid

Zig
pub fn isInRaid(self: Player) core.Error!bool

PIER_PPROP_IS_IN_RAID: (G) Player::isInRaid

Player.isHurt

Zig
pub fn isHurt(self: Player) core.Error!bool

PIER_PPROP_IS_HURT: (G) Player::isHurt

Player.isScoping

Zig
pub fn isScoping(self: Player) core.Error!bool

PIER_PPROP_IS_SCOPING: (G) Player::isScoping

Player.canSleep

Zig
pub fn canSleep(self: Player) core.Error!bool

PIER_PPROP_CAN_SLEEP: (G) Player::canSleep

Player.hasRespawnPosition

Zig
pub fn hasRespawnPosition(self: Player) core.Error!bool

PIER_PPROP_HAS_RESPAWN_POSITION: (G) Player::hasRespawnPosition

Player.clientSubId

Zig
pub fn clientSubId(self: Player) core.Error!f64

PIER_PPROP_CLIENT_SUB_ID: (G) Player::getClientSubId

Player.canUseAbility

Zig
pub fn canUseAbility(self: Player) core.Error!bool

PIER_PPROP_CAN_USE_ABILITY: (G) Player::canUseAbility; the ability index is passed through the player_action GET path, see PIER_PACT_CAN_USE_ABILITY

Player.direction

Zig
pub fn direction(self: Player) core.Error!f64

PIER_PPROP_DIRECTION: (G) Player::getDirection (0=S,1=W,2=N,3=E)

Player.chunkRadius

Zig
pub fn chunkRadius(self: Player) core.Error!f64

PIER_PPROP_CHUNK_RADIUS: (G) Player::getChunkRadius

Player.networkRtt

Zig
pub fn networkRtt(self: Player) core.Error!f64

PIER_PPROP_NETWORK_RTT: (G) getNetworkStatus().mPing (ms)

Player.platform

Zig
pub fn platform(self: Player) core.Error!f64

PIER_PPROP_PLATFORM: (G) Player::getPlatform

Player.enchantmentSeed

Zig
pub fn enchantmentSeed(self: Player) core.Error!f64

PIER_PPROP_ENCHANTMENT_SEED: (G) Player::getEnchantmentSeed

Player.isUsingItem

Zig
pub fn isUsingItem(self: Player) core.Error!bool

PIER_PPROP_IS_USING_ITEM: (G) Player::isUsingItem

Player.isBlocking

Zig
pub fn isBlocking(self: Player) core.Error!bool

PIER_PPROP_IS_BLOCKING: (G) Player::isBlocking

Player.isGliding

Zig
pub fn isGliding(self: Player) core.Error!bool

PIER_PPROP_IS_GLIDING: (G) Player::isGliding

Player.isSwimming

Zig
pub fn isSwimming(self: Player) core.Error!bool

PIER_PPROP_IS_SWIMMING: (G) Player::isSwimming

Player.permissionLevel

Zig
pub fn permissionLevel(self: Player) core.Error!f64

PIER_PPROP_PERMISSION_LEVEL: (G) Player::getPlayerPermissionLevel

Player.score

Zig
pub fn score(self: Player) core.Error!f64

PIER_PPROP_SCORE: (G) Player::getScore

Player.fallDistance

Zig
pub fn fallDistance(self: Player) core.Error!f64

PIER_PPROP_FALL_DISTANCE: (G) Actor::getFallDistance

Player.isDead

Zig
pub fn isDead(self: Player) core.Error!bool

PIER_PPROP_IS_DEAD: (G) Actor::isDead

Player.hasDiedBefore

Zig
pub fn hasDiedBefore(self: Player) core.Error!bool

PIER_PPROP_HAS_DIED_BEFORE: (G) Player::hasDiedBefore

Player.dimension

Zig
pub fn dimension(self: Player) core.Error!f64

PIER_PPROP_DIMENSION: (G) Actor::getDimensionId

Player.isInitialized

Zig
pub fn isInitialized(self: Player) core.Error!bool

PIER_PPROP_IS_INITIALIZED: (G) Player::isPlayerInitialized; 1 for a simulated player

Player.isSleeping

Zig
pub fn isSleeping(self: Player) core.Error!bool

PIER_PPROP_IS_SLEEPING: (G) Player::isSleeping

Player.isSimulated

Zig
pub fn isSimulated(self: Player) core.Error!bool

PIER_PPROP_IS_SIMULATED: (G) Actor::isSimulatedPlayer

Player.itemUseDuration

Zig
pub fn itemUseDuration(self: Player) core.Error!f64

PIER_PPROP_ITEM_USE_DURATION: (G) Player::getItemUseDuration, in ticks

Player.xpEarnedAtLevel

Zig
pub fn xpEarnedAtLevel(self: Player) core.Error!f64

PIER_PPROP_XP_EARNED_AT_LEVEL: (G) Player::getXpEarnedAtCurrentLevel

Player.canFly

Zig
pub fn canFly(self: Player) core.Error!bool

PIER_PPROP_CAN_FLY: (G) Actor::canFly

Player.realName

Zig
pub fn realName(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_REAL_NAME: Player::getRealName

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.uuid

Zig
pub fn uuid(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_UUID: Player::getUuid().asString()

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.xuid

Zig
pub fn xuid(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_XUID: Player::getXuid

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.ipAndPort

Zig
pub fn ipAndPort(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_IP_AND_PORT: Player::getIPAndPort

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.localeCode

Zig
pub fn localeCode(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_LOCALE_CODE: Player::getLocaleCode

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.nameTag

Zig
pub fn nameTag(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_NAME_TAG: Actor::getNameTag (display name)

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.lastDeathPos

Zig
pub fn lastDeathPos(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_LAST_DEATH_POS: SNBT {x,y,z} or "" if none

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.lastDeathDimension

Zig
pub fn lastDeathDimension(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_LAST_DEATH_DIMENSION: dimension id as string

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.networkStatus

Zig
pub fn networkStatus(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_NETWORK_STATUS: SNBT {ping,avg_ping,packet_loss,max_ping}

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.platformOnlineId

Zig
pub fn platformOnlineId(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_PLATFORM_ONLINE_ID: Player::getPlatformOnlineId

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.respawnPos

Zig
pub fn respawnPos(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_RESPAWN_POS: SNBT {x,y,z,dim}: where this player would respawn. Never empty; a player with no bed reports the world spawn, and the two are not distinguishable.

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.selectedItem

Zig
pub fn selectedItem(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_SELECTED_ITEM: Player::getSelectedItem as item SNBT

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.deviceModel

Zig
pub fn deviceModel(self: Player, allocator: std.mem.Allocator) core.Error![]u8

PIER_PSTR_DEVICE_MODEL: ConnectionRequest::getDeviceModel; fails for a player with no connection request

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error![]u8
  • Slots: player_get_str

Player.setAbility

Zig
pub fn setAbility(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SET_ABILITY: a=AbilitiesIndex, b=0/1 (bool slots) or float (FlySpeed etc.). Restores PlayerPermissionLevel to its pre-write value afterwards: the engine's LayeredAbilities::setAbility is the "switch to custom permissions" path and pushes the player to Custom, and that level ships to the client inside UpdateAbilitiesPacket together with the ability layer. To change the level, use PIER_PACT_SET_PERMISSION_LEVEL. Refused (false) until the player has finished joining (Player::isPlayerInitialized): an ability written while the client is still loading desynchronizes until the player rejoins. Simulated players are exempt.

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.canUseAbilityAction

Zig
pub fn canUseAbilityAction(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_CAN_USE_ABILITY: a=AbilitiesIndex β†’ out "0"/"1" Player::canUseAbility

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.setSelectedSlot

Zig
pub fn setSelectedSlot(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SET_SELECTED_SLOT: a=slot Player::setSelectedSlot

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.giveItem

Zig
pub fn giveItem(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_GIVE_ITEM: sarg=item SNBT ItemStack::fromTag + Player::addAndRefresh

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.setSpawnPoint

Zig
pub fn setSpawnPoint(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SET_SPAWN_POINT: a,b,c=pos, sarg=dim id (any registered dim); native Player::setRespawnPosition

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.clearTitle

Zig
pub fn clearTitle(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_CLEAR_TITLE: native SetTitlePacket(Clear)

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.setTitle

Zig
pub fn setTitle(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SET_TITLE: sarg=text, a=slot(0 title,1 subtitle,2 actionbar); native SetTitlePacket, text sent verbatim

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.addExperience

Zig
pub fn addExperience(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_ADD_EXPERIENCE: a=xp Player::addExperience

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.addLevels

Zig
pub fn addLevels(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_ADD_LEVELS: a=levels Player::addLevels

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.startCooldown

Zig
pub fn startCooldown(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_START_COOLDOWN: sarg=item name, a=ticks Player::startItemCooldown

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.startRiding

Zig
pub fn startRiding(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_START_RIDING: a=vehicle ActorUniqueID (lower 64b) Player::startRiding

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.stopRiding

Zig
pub fn stopRiding(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_STOP_RIDING: Player::stopRiding

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.attack

Zig
pub fn attack(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_ATTACK: a=target ActorUniqueID (lower 64b) Player::attack

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.drop

Zig
pub fn drop(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_DROP: sarg=item SNBT, a=random(0/1) Player::drop

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.interact

Zig
pub fn interact(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_INTERACT: a=target ActorUniqueID Player::interact

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.startUsingItem

Zig
pub fn startUsingItem(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_START_USING_ITEM: sarg=item SNBT, a=duration Player::startUsingItem

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.stopUsingItem

Zig
pub fn stopUsingItem(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_STOP_USING_ITEM: Player::stopUsingItem

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.setChunkRadius

Zig
pub fn setChunkRadius(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SET_CHUNK_RADIUS: a=radius Player::setChunkRadius

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.setEnchantmentSeed

Zig
pub fn setEnchantmentSeed(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SET_ENCHANTMENT_SEED: a=seed Player::setEnchantmentSeed

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.registerTrackedBoss

Zig
pub fn registerTrackedBoss(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_REGISTER_TRACKED_BOSS: a=boss ActorUniqueID Player::registerTrackedBoss

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.unregisterTrackedBoss

Zig
pub fn unregisterTrackedBoss(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_UNREGISTER_TRACKED_BOSS: a=boss ActorUniqueID Player::unRegisterTrackedBoss

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.playEmote

Zig
pub fn playEmote(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_PLAY_EMOTE: sarg=piece id Player::playEmote

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.resendAllChunks

Zig
pub fn resendAllChunks(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_RESEND_ALL_CHUNKS: Player::resendAllChunks

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.openInventory

Zig
pub fn openInventory(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_OPEN_INVENTORY: Player::openInventory

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.sidebarSet

Zig
pub fn sidebarSet(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SIDEBAR_SET: sarg="obj\ntitle\nline…" per-player sidebar

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.sidebarClear

Zig
pub fn sidebarClear(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SIDEBAR_CLEAR: sarg=objective RemoveObjectivePacket

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.setPermissionLevel

Zig
pub fn setPermissionLevel(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_SET_PERMISSION_LEVEL: a=PlayerPermissionLevel (0 Visitor, 1 Member, 2 Operator, 3 Custom). LayeredAbilities::setPlayerPermissions plus UpdateAbilitiesPacket. The read side is PIER_PPROP_PERMISSION_LEVEL. Refused until the player has finished joining, like PIER_PACT_SET_ABILITY.

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.stopSleeping

Zig
pub fn stopSleeping(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_STOP_SLEEPING: a: non-zero wakes forcefully. Player::stopSleepInBed; false when not asleep

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.causeExhaustion

Zig
pub fn causeExhaustion(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_CAUSE_EXHAUSTION: a: amount, positive. Player::causeFoodExhaustion

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.eat

Zig
pub fn eat(self: Player, allocator: std.mem.Allocator, s_arg: []const u8, n_a: f64, n_b: f64, n_c: f64) core.Error![]u8

PIER_PACT_EAT: sarg: item SNBT. Player::eat, the food value of that item

The output, when the verb has one, is returned; abi.h names each argument.

  • Parameters:
    • allocator : std.mem.Allocator
    • s_arg : []const u8
    • n_a : f64
    • n_b : f64
    • n_c : f64
  • Return type: core.Error![]u8
  • Slots: player_action

Player.asEntity

Zig
pub fn asEntity(self: Player) core.Error!Entity

Resolves the selector to the player's actor, which gives the calls of Entity. NoAnswer when the player is offline.

Player.isOnline

Zig
pub fn isOnline(self: Player) bool

Whether the selector resolves to anyone online now.

Player.connId

Zig
pub fn connId(self: Player) core.Error!u64

The connection id of this player, the same number a packet handler sees. NoAnswer when the player is offline or has no network identity.

Player.teleport

Zig
pub fn teleport(self: Player, dim: i32, x: f64, y: f64, z: f64) core.Error!void

Teleports. A custom dimension, with an id of 3 or above, goes through here too, and the host refuses a dimension whose engine instance does not match.

  • Parameters:
    • dim : i32
    • x : f64
    • y : f64
    • z : f64
  • Return type: core.Error!void
  • Slots: player_teleport

Player.sendMessage

Zig
pub fn sendMessage(self: Player, msg: []const u8) core.Error!void

Player.tell

Zig
pub fn tell(self: Player, msg: []const u8, kind: types.MessageType) core.Error!void

Sends one message with a given TextPacketType.

Player.sendTitle

Zig
pub fn sendTitle(self: Player, kind: types.TitleKind, text: []const u8, times: ?types.TitleTimes) core.Error!void

Sends one title. Only a title, a subtitle or an action bar carries text. times of null leaves the durations to the host.

  • Parameters:
    • kind : types.TitleKind
    • text : []const u8
    • times : ?types.TitleTimes
  • Return type: core.Error!void
  • Slots: player_send_title

Player.setGameMode

Zig
pub fn setGameMode(self: Player, mode: types.GameMode) core.Error!void

Player.disconnect

Zig
pub fn disconnect(self: Player, reason: []const u8) core.Error!void

Disconnects the player with a reason the client shows.

  • Parameters:
    • reason : []const u8
  • Return type: core.Error!void
  • Slots: player_disconnect

Player.item

Zig
pub fn item(self: Player, allocator: std.mem.Allocator, slot: i32) core.Error![]u8

One inventory slot as item SNBT, owned by the caller.

  • Parameters:
    • allocator : std.mem.Allocator
    • slot : i32
  • Return type: core.Error![]u8
  • Slots: player_get_item

Player.setItem

Zig
pub fn setItem(self: Player, slot: i32, item_snbt: []const u8) core.Error!void

Writes one inventory slot. Refresh the container afterwards, or the client keeps showing the old item.

  • Parameters:
    • slot : i32
    • item_snbt : []const u8
  • Return type: core.Error!void
  • Slots: player_set_item

Player.carriedItem

Zig
pub fn carriedItem(self: Player, allocator: std.mem.Allocator) core.Error![]u8

The item in hand as item SNBT, owned by the caller.

Player.equipment

Zig
pub fn equipment(self: Player, allocator: std.mem.Allocator) core.Error!types.Owned(types.EquipmentEntry)

The full equipment set. For the slot numbering see types.EquipSlot.

  • Parameters:
    • allocator : std.mem.Allocator
  • Return type: core.Error!types.Owned(types.EquipmentEntry)
  • Slots: player_get_equipment

Player.cooldown

Zig
pub fn cooldown(self: Player, item_name: []const u8) core.Error!?i32

How many ticks of cooldown one item has left; null when it is not on cooldown.

Player.setCooldown

Zig
pub fn setCooldown(self: Player, item_name: []const u8, ticks: i32) core.Error!void
  • Parameters:
    • item_name : []const u8
    • ticks : i32
  • Return type: core.Error!void
  • Slots: player_start_cooldown

Player.networkDetail

Zig
pub fn networkDetail(self: Player, allocator: std.mem.Allocator) core.Error!types.NetworkStatus

The network status in detail.

Player.position

Zig
pub fn position(self: Player, allocator: std.mem.Allocator) core.Error!types.PlayerPosition

The feet position and the dimension. It goes through a dedicated slot and not a property number, because a position needs three numbers and an id at once.

Player.inventory

Zig
pub fn inventory(self: Player) container.Container
  • Return type: container.Container

Player.enderChest

Zig
pub fn enderChest(self: Player) container.Container
  • Return type: container.Container

Player.armor

Zig
pub fn armor(self: Player) container.Container
  • Return type: container.Container

Player.offhandContainer

Zig
pub fn offhandContainer(self: Player) container.Container
  • Return type: container.Container

SelKind

Zig
1
2
3
pub const SelKind = enum(i32) {
    name = 0, xuid = 1, uuid = 2
};

How a Player selector names its player. A decision about permissions, money or ownership keys on the xuid: a name can change hands.