Skip to content

Go: Players

Functions

PlayerByName

Go
func PlayerByName(name string) Player

PlayerByName is the player with this name. A decision about permissions, money or ownership uses PlayerByXuid: a name can change hands.

  • Parameters:
    • name : string
  • Return type: Player

PlayerByXuid

Go
func PlayerByXuid(xuid string) Player

PlayerByXuid is the player with this xuid.

  • Parameters:
    • xuid : string
  • Return type: Player

PlayerByUuid

Go
func PlayerByUuid(uuid string) Player

PlayerByUuid is the player with this uuid.

  • Parameters:
    • uuid : string
  • Return type: Player

Broadcast

Go
func Broadcast(msg string) error

Broadcast sends a message to every online player.

ListPlayers

Go
func ListPlayers() ([]PlayerInfo, error)

ListPlayers lists the online players. An entry that does not parse is skipped with a warning, so one bad entry does not make who is online unanswerable.

ByName

Go
func ByName(name string) PlayerSel

ByName selects a player by name.

  • Parameters:
    • name : string
  • Return type: PlayerSel

ByXuid

Go
func ByXuid(xuid string) PlayerSel

ByXuid selects a player by xuid.

  • Parameters:
    • xuid : string
  • Return type: PlayerSel

ByUuid

Go
func ByUuid(uuid string) PlayerSel

ByUuid selects a player by uuid.

  • Parameters:
    • uuid : string
  • Return type: PlayerSel

Player

Go
1
2
3
type Player struct {
    Sel PlayerSel
}

Player is one player, named by a selector. Most of its methods are generated from the constant tables of abi.h, one per property and verb; the rest are below.

Player.Resolve

Go
func (p Player) Resolve() (Entity, error)

Resolve is the player's actor. An error means nobody matches the selector.

Player.IsOnline

Go
func (p Player) IsOnline() bool

IsOnline reports whether the selector matches an online player. Every ABI v2 host has the slot it asks, so false means nobody matches.

Player.SendMessage

Go
func (p Player) SendMessage(msg string) error

SendMessage sends a chat line to the player.

Player.SendMessageTyped

Go
func (p Player) SendMessageTyped(msg string, kind int32) error

SendMessageTyped sends a message of a given TextPacket type to the player.

Player.SendTitle

Go
func (p Player) SendTitle(slot int32, text string, fadeIn, stay, fadeOut int32) error

SendTitle shows a title: slot 0 title, 1 subtitle, 2 action bar; the times are in ticks.

  • Parameters:
    • slot : int32
    • text : string
    • fadeIn : int32
    • stay : int32
    • fadeOut : int32
  • Return type: error
  • Slots: player_send_title

Player.Disconnect

Go
func (p Player) Disconnect(reason string) error

Disconnect removes the player from the server with a reason.

Player.SetGameType

Go
func (p Player) SetGameType(mode int32) error

SetGameType sets the player's game mode, the value GameType reads.

Player.Teleport

Go
func (p Player) Teleport(dim int32, x, y, z float64) error

Teleport moves the player to a position of any registered dimension.

  • Parameters:
    • dim : int32
    • x : float64
    • y : float64
    • z : float64
  • Return type: error
  • Slots: player_teleport

Player.CarriedItem

Go
func (p Player) CarriedItem() (Item, error)

CarriedItem is the item in the player's hand.

Player.InventoryItem

Go
func (p Player) InventoryItem(slot int32) (Item, error)

InventoryItem is the item in one inventory slot.

  • Parameters:
    • slot : int32
  • Return type: (Item, error)
  • Slots: player_get_item

Player.SetInventoryItem

Go
func (p Player) SetInventoryItem(slot int32, item Item) error

SetInventoryItem puts an item into one inventory slot.

  • Parameters:
    • slot : int32
    • item : Item
  • Return type: error
  • Slots: player_set_item

Player.ConnID

Go
func (p Player) ConnID() (uint64, error)

ConnID is the player's network connection id.

Player.Inventory

Go
func (p Player) Inventory() Container

Inventory is the player's inventory as a container.

  • Return type: Container

Player.EnderChest

Go
func (p Player) EnderChest() Container

EnderChest is the player's ender chest as a container.

  • Return type: Container

Player.Armor

Go
func (p Player) Armor() Container

Armor is the player's armor slots as a container.

  • Return type: Container

Player.Offhand

Go
func (p Player) Offhand() Container

Offhand is the player's offhand slot as a container.

  • Return type: Container

Player.GameType

Go
func (p Player) GameType() (float64, error)

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

Player.Level

Go
func (p Player) Level() (float64, error)

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

Player.SetLevel

Go
func (p Player) SetLevel(v float64) error

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

Player.Experience

Go
func (p Player) Experience() (float64, error)

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

Player.SetExperience

Go
func (p Player) SetExperience(v float64) error

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

Player.Hunger

Go
func (p Player) Hunger() (float64, error)

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

Player.SetHunger

Go
func (p Player) SetHunger(v float64) error

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

Player.Saturation

Go
func (p Player) Saturation() (float64, error)

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

Player.SetSaturation

Go
func (p Player) SetSaturation(v float64) error

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

Player.Exhaustion

Go
func (p Player) Exhaustion() (float64, error)

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

Player.SetExhaustion

Go
func (p Player) SetExhaustion(v float64) error

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

Player.XpNeededNextLevel

Go
func (p Player) XpNeededNextLevel() (float64, error)

XpNeededNextLevel reads PIER_PPROP_XP_NEEDED_NEXT_LEVEL: (G) Player::getXpNeededForNextLevel

Player.Luck

Go
func (p Player) Luck() (float64, error)

Luck reads PIER_PPROP_LUCK: (G) Player::getLuck

Player.SelectedSlot

Go
func (p Player) SelectedSlot() (float64, error)

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

Player.IsOperator

Go
func (p Player) IsOperator() (bool, error)

IsOperator reads PIER_PPROP_IS_OPERATOR: (G) Player::isOperator

Player.CanUseOperatorBlocks

Go
func (p Player) CanUseOperatorBlocks() (bool, error)

CanUseOperatorBlocks reads PIER_PPROP_CAN_USE_OPERATOR_BLOCKS: (G) Player::canUseOperatorBlocks

Player.IsFlying

Go
func (p Player) IsFlying() (bool, error)

IsFlying reads PIER_PPROP_IS_FLYING: (G) Player::isFlying

Player.CanJump

Go
func (p Player) CanJump() (bool, error)

CanJump reads PIER_PPROP_CAN_JUMP: (G) Player::canJump

Player.IsEmoting

Go
func (p Player) IsEmoting() (bool, error)

IsEmoting reads PIER_PPROP_IS_EMOTING: (G) Player::isEmoting

Player.IsInRaid

Go
func (p Player) IsInRaid() (bool, error)

IsInRaid reads PIER_PPROP_IS_IN_RAID: (G) Player::isInRaid

Player.IsHurt

Go
func (p Player) IsHurt() (bool, error)

IsHurt reads PIER_PPROP_IS_HURT: (G) Player::isHurt

Player.IsScoping

Go
func (p Player) IsScoping() (bool, error)

IsScoping reads PIER_PPROP_IS_SCOPING: (G) Player::isScoping

Player.CanSleep

Go
func (p Player) CanSleep() (bool, error)

CanSleep reads PIER_PPROP_CAN_SLEEP: (G) Player::canSleep

Player.HasRespawnPosition

Go
func (p Player) HasRespawnPosition() (bool, error)

HasRespawnPosition reads PIER_PPROP_HAS_RESPAWN_POSITION: (G) Player::hasRespawnPosition

Player.ClientSubId

Go
func (p Player) ClientSubId() (float64, error)

ClientSubId reads PIER_PPROP_CLIENT_SUB_ID: (G) Player::getClientSubId

Player.CanUseAbility

Go
func (p Player) CanUseAbility() (bool, error)

CanUseAbility reads 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

Go
func (p Player) Direction() (float64, error)

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

Player.ChunkRadius

Go
func (p Player) ChunkRadius() (float64, error)

ChunkRadius reads PIER_PPROP_CHUNK_RADIUS: (G) Player::getChunkRadius

Player.NetworkRtt

Go
func (p Player) NetworkRtt() (float64, error)

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

Player.Platform

Go
func (p Player) Platform() (float64, error)

Platform reads PIER_PPROP_PLATFORM: (G) Player::getPlatform

Player.EnchantmentSeed

Go
func (p Player) EnchantmentSeed() (float64, error)

EnchantmentSeed reads PIER_PPROP_ENCHANTMENT_SEED: (G) Player::getEnchantmentSeed

Player.IsUsingItem

Go
func (p Player) IsUsingItem() (bool, error)

IsUsingItem reads PIER_PPROP_IS_USING_ITEM: (G) Player::isUsingItem

Player.IsBlocking

Go
func (p Player) IsBlocking() (bool, error)

IsBlocking reads PIER_PPROP_IS_BLOCKING: (G) Player::isBlocking

Player.IsGliding

Go
func (p Player) IsGliding() (bool, error)

IsGliding reads PIER_PPROP_IS_GLIDING: (G) Player::isGliding

Player.IsSwimming

Go
func (p Player) IsSwimming() (bool, error)

IsSwimming reads PIER_PPROP_IS_SWIMMING: (G) Player::isSwimming

Player.PermissionLevel

Go
func (p Player) PermissionLevel() (float64, error)

PermissionLevel reads PIER_PPROP_PERMISSION_LEVEL: (G) Player::getPlayerPermissionLevel

Player.Score

Go
func (p Player) Score() (float64, error)

Score reads PIER_PPROP_SCORE: (G) Player::getScore

Player.FallDistance

Go
func (p Player) FallDistance() (float64, error)

FallDistance reads PIER_PPROP_FALL_DISTANCE: (G) Actor::getFallDistance

Player.IsDead

Go
func (p Player) IsDead() (bool, error)

IsDead reads PIER_PPROP_IS_DEAD: (G) Actor::isDead

Player.HasDiedBefore

Go
func (p Player) HasDiedBefore() (bool, error)

HasDiedBefore reads PIER_PPROP_HAS_DIED_BEFORE: (G) Player::hasDiedBefore

Player.Dimension

Go
func (p Player) Dimension() (float64, error)

Dimension reads PIER_PPROP_DIMENSION: (G) Actor::getDimensionId

Player.RealName

Go
func (p Player) RealName() (string, error)

RealName reads PIER_PSTR_REAL_NAME: Player::getRealName

Player.Uuid

Go
func (p Player) Uuid() (string, error)

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

Player.Xuid

Go
func (p Player) Xuid() (string, error)

Xuid reads PIER_PSTR_XUID: Player::getXuid

Player.IpAndPort

Go
func (p Player) IpAndPort() (string, error)

IpAndPort reads PIER_PSTR_IP_AND_PORT: Player::getIPAndPort

Player.LocaleCode

Go
func (p Player) LocaleCode() (string, error)

LocaleCode reads PIER_PSTR_LOCALE_CODE: Player::getLocaleCode

Player.NameTag

Go
func (p Player) NameTag() (string, error)

NameTag reads PIER_PSTR_NAME_TAG: Actor::getNameTag (display name)

Player.LastDeathPos

Go
func (p Player) LastDeathPos() (string, error)

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

Player.LastDeathDimension

Go
func (p Player) LastDeathDimension() (string, error)

LastDeathDimension reads PIER_PSTR_LAST_DEATH_DIMENSION: dimension id as string

Player.NetworkStatus

Go
func (p Player) NetworkStatus() (string, error)

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

Player.PlatformOnlineId

Go
func (p Player) PlatformOnlineId() (string, error)

PlatformOnlineId reads PIER_PSTR_PLATFORM_ONLINE_ID: Player::getPlatformOnlineId

Player.RespawnPos

Go
func (p Player) RespawnPos() (string, error)

RespawnPos reads 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.

Player.SetAbility

Go
func (p Player) SetAbility(sarg string, a, b, c float64) (string, error)

SetAbility runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.CanUseAbilityAction

Go
func (p Player) CanUseAbilityAction(sarg string, a, b, c float64) (string, error)

CanUseAbilityAction runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SetSelectedSlot

Go
func (p Player) SetSelectedSlot(sarg string, a, b, c float64) (string, error)

SetSelectedSlot runs PIER_PACT_SET_SELECTED_SLOT: a=slot Player::setSelectedSlot

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.GiveItem

Go
func (p Player) GiveItem(sarg string, a, b, c float64) (string, error)

GiveItem runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SetSpawnPoint

Go
func (p Player) SetSpawnPoint(sarg string, a, b, c float64) (string, error)

SetSpawnPoint runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.ClearTitle

Go
func (p Player) ClearTitle(sarg string, a, b, c float64) (string, error)

ClearTitle runs PIER_PACT_CLEAR_TITLE: native SetTitlePacket(Clear)

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SetTitle

Go
func (p Player) SetTitle(sarg string, a, b, c float64) (string, error)

SetTitle runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.AddExperience

Go
func (p Player) AddExperience(sarg string, a, b, c float64) (string, error)

AddExperience runs PIER_PACT_ADD_EXPERIENCE: a=xp Player::addExperience

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.AddLevels

Go
func (p Player) AddLevels(sarg string, a, b, c float64) (string, error)

AddLevels runs PIER_PACT_ADD_LEVELS: a=levels Player::addLevels

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.StartCooldown

Go
func (p Player) StartCooldown(sarg string, a, b, c float64) (string, error)

StartCooldown runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.StartRiding

Go
func (p Player) StartRiding(sarg string, a, b, c float64) (string, error)

StartRiding runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.StopRiding

Go
func (p Player) StopRiding(sarg string, a, b, c float64) (string, error)

StopRiding runs PIER_PACT_STOP_RIDING: Player::stopRiding

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.Attack

Go
func (p Player) Attack(sarg string, a, b, c float64) (string, error)

Attack runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.Drop

Go
func (p Player) Drop(sarg string, a, b, c float64) (string, error)

Drop runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.Interact

Go
func (p Player) Interact(sarg string, a, b, c float64) (string, error)

Interact runs PIER_PACT_INTERACT: a=target ActorUniqueID Player::interact

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.StartUsingItem

Go
func (p Player) StartUsingItem(sarg string, a, b, c float64) (string, error)

StartUsingItem runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.StopUsingItem

Go
func (p Player) StopUsingItem(sarg string, a, b, c float64) (string, error)

StopUsingItem runs PIER_PACT_STOP_USING_ITEM: Player::stopUsingItem

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SetChunkRadius

Go
func (p Player) SetChunkRadius(sarg string, a, b, c float64) (string, error)

SetChunkRadius runs PIER_PACT_SET_CHUNK_RADIUS: a=radius Player::setChunkRadius

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SetEnchantmentSeed

Go
func (p Player) SetEnchantmentSeed(sarg string, a, b, c float64) (string, error)

SetEnchantmentSeed runs PIER_PACT_SET_ENCHANTMENT_SEED: a=seed Player::setEnchantmentSeed

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.RegisterTrackedBoss

Go
func (p Player) RegisterTrackedBoss(sarg string, a, b, c float64) (string, error)

RegisterTrackedBoss runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.UnregisterTrackedBoss

Go
func (p Player) UnregisterTrackedBoss(sarg string, a, b, c float64) (string, error)

UnregisterTrackedBoss runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.PlayEmote

Go
func (p Player) PlayEmote(sarg string, a, b, c float64) (string, error)

PlayEmote runs PIER_PACT_PLAY_EMOTE: sarg=piece id Player::playEmote

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.ResendAllChunks

Go
func (p Player) ResendAllChunks(sarg string, a, b, c float64) (string, error)

ResendAllChunks runs PIER_PACT_RESEND_ALL_CHUNKS: Player::resendAllChunks

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.OpenInventory

Go
func (p Player) OpenInventory(sarg string, a, b, c float64) (string, error)

OpenInventory runs PIER_PACT_OPEN_INVENTORY: Player::openInventory

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SidebarSet

Go
func (p Player) SidebarSet(sarg string, a, b, c float64) (string, error)

SidebarSet runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SidebarClear

Go
func (p Player) SidebarClear(sarg string, a, b, c float64) (string, error)

SidebarClear runs PIER_PACT_SIDEBAR_CLEAR: sarg=objective RemoveObjectivePacket

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

  • Parameters:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

Player.SetPermissionLevel

Go
func (p Player) SetPermissionLevel(sarg string, a, b, c float64) (string, error)

SetPermissionLevel runs 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:
    • sarg : string
    • a : float64
    • b : float64
    • c : float64
  • Return type: (string, error)
  • Slots: player_action

PlayerInfo

Go
1
2
3
4
5
6
7
type PlayerInfo struct {
    Name, Xuid, Uuid string
    Dim              int32
    HasDim           bool
    X, Y, Z          float64
    HasPos           bool
}

PlayerInfo is one online player as ListPlayers reports it. Dim and the position are read only when present, and HasDim and HasPos say whether they were.

SelKind

Go
type SelKind int32

SelKind says how a PlayerSel names its player.

Name Value Description
SelName 0
SelXuid 1
SelUuid 2

PlayerSel

Go
1
2
3
4
type PlayerSel struct {
    Kind  SelKind
    Value string
}

PlayerSel names one player by name, xuid or uuid.

PlayerPos

Go
1
2
3
4
5
type PlayerPos struct {
    X, Y, Z   float64
    Dimension int32
    Found     bool
}

PlayerPos is where a player is; Found is false when nobody matched.

PProp*

Name Value Description
PPropGameType 0 PPropGameType is PIER_PPROP_GAME_TYPE: (G) Player::getPlayerGameType; write via player_set_gamemode
PPropLevel 1 PPropLevel is PIER_PPROP_LEVEL: (S) attribute Player::LEVEL()
PPropExperience 2 PPropExperience is PIER_PPROP_EXPERIENCE: (S) attribute Player::EXPERIENCE() (progress 0..1)
PPropHunger 3 PPropHunger is PIER_PPROP_HUNGER: (S) attribute Player::HUNGER()
PPropSaturation 4 PPropSaturation is PIER_PPROP_SATURATION: (S) attribute Player::SATURATION()
PPropExhaustion 5 PPropExhaustion is PIER_PPROP_EXHAUSTION: (S) attribute Player::EXHAUSTION()
PPropXpNeededNextLevel 6 PPropXpNeededNextLevel is PIER_PPROP_XP_NEEDED_NEXT_LEVEL: (G) Player::getXpNeededForNextLevel
PPropLuck 7 PPropLuck is PIER_PPROP_LUCK: (G) Player::getLuck
PPropSelectedSlot 8 PPropSelectedSlot is PIER_PPROP_SELECTED_SLOT: (G) Player::getSelectedItemSlot; set via PIER_PACT_SET_SELECTED_SLOT
PPropIsOperator 9 PPropIsOperator is PIER_PPROP_IS_OPERATOR: (G) Player::isOperator
PPropCanUseOperatorBlocks 10 PPropCanUseOperatorBlocks is PIER_PPROP_CAN_USE_OPERATOR_BLOCKS: (G) Player::canUseOperatorBlocks
PPropIsFlying 11 PPropIsFlying is PIER_PPROP_IS_FLYING: (G) Player::isFlying
PPropCanJump 12 PPropCanJump is PIER_PPROP_CAN_JUMP: (G) Player::canJump
PPropIsEmoting 13 PPropIsEmoting is PIER_PPROP_IS_EMOTING: (G) Player::isEmoting
PPropIsInRaid 14 PPropIsInRaid is PIER_PPROP_IS_IN_RAID: (G) Player::isInRaid
PPropIsHurt 15 PPropIsHurt is PIER_PPROP_IS_HURT: (G) Player::isHurt
PPropIsScoping 16 PPropIsScoping is PIER_PPROP_IS_SCOPING: (G) Player::isScoping
PPropCanSleep 17 PPropCanSleep is PIER_PPROP_CAN_SLEEP: (G) Player::canSleep
PPropHasRespawnPosition 18 PPropHasRespawnPosition is PIER_PPROP_HAS_RESPAWN_POSITION: (G) Player::hasRespawnPosition
PPropClientSubId 19 PPropClientSubId is PIER_PPROP_CLIENT_SUB_ID: (G) Player::getClientSubId
PPropCanUseAbility 20 PPropCanUseAbility is 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
PPropDirection 21 PPropDirection is PIER_PPROP_DIRECTION: (G) Player::getDirection (0=S,1=W,2=N,3=E)
PPropChunkRadius 22 PPropChunkRadius is PIER_PPROP_CHUNK_RADIUS: (G) Player::getChunkRadius
PPropNetworkRtt 23 PPropNetworkRtt is PIER_PPROP_NETWORK_RTT: (G) getNetworkStatus().mPing (ms)
PPropPlatform 24 PPropPlatform is PIER_PPROP_PLATFORM: (G) Player::getPlatform
PPropEnchantmentSeed 25 PPropEnchantmentSeed is PIER_PPROP_ENCHANTMENT_SEED: (G) Player::getEnchantmentSeed
PPropIsUsingItem 26 PPropIsUsingItem is PIER_PPROP_IS_USING_ITEM: (G) Player::isUsingItem
PPropIsBlocking 27 PPropIsBlocking is PIER_PPROP_IS_BLOCKING: (G) Player::isBlocking
PPropIsGliding 28 PPropIsGliding is PIER_PPROP_IS_GLIDING: (G) Player::isGliding
PPropIsSwimming 29 PPropIsSwimming is PIER_PPROP_IS_SWIMMING: (G) Player::isSwimming
PPropPermissionLevel 30 PPropPermissionLevel is PIER_PPROP_PERMISSION_LEVEL: (G) Player::getPlayerPermissionLevel
PPropScore 31 PPropScore is PIER_PPROP_SCORE: (G) Player::getScore
PPropFallDistance 32 PPropFallDistance is PIER_PPROP_FALL_DISTANCE: (G) Actor::getFallDistance
PPropIsDead 33 PPropIsDead is PIER_PPROP_IS_DEAD: (G) Actor::isDead
PPropHasDiedBefore 34 PPropHasDiedBefore is PIER_PPROP_HAS_DIED_BEFORE: (G) Player::hasDiedBefore
PPropDimension 35 PPropDimension is PIER_PPROP_DIMENSION: (G) Actor::getDimensionId

PStr*

Name Value Description
PStrRealName 0 PStrRealName is PIER_PSTR_REAL_NAME: Player::getRealName
PStrUuid 1 PStrUuid is PIER_PSTR_UUID: Player::getUuid().asString()
PStrXuid 2 PStrXuid is PIER_PSTR_XUID: Player::getXuid
PStrIpAndPort 3 PStrIpAndPort is PIER_PSTR_IP_AND_PORT: Player::getIPAndPort
PStrLocaleCode 4 PStrLocaleCode is PIER_PSTR_LOCALE_CODE: Player::getLocaleCode
PStrNameTag 5 PStrNameTag is PIER_PSTR_NAME_TAG: Actor::getNameTag (display name)
PStrLastDeathPos 6 PStrLastDeathPos is PIER_PSTR_LAST_DEATH_POS: SNBT {x,y,z} or "" if none
PStrLastDeathDimension 7 PStrLastDeathDimension is PIER_PSTR_LAST_DEATH_DIMENSION: dimension id as string
PStrNetworkStatus 8 PStrNetworkStatus is PIER_PSTR_NETWORK_STATUS: SNBT {ping,avg_ping,packet_loss,max_ping}
PStrPlatformOnlineId 9 PStrPlatformOnlineId is PIER_PSTR_PLATFORM_ONLINE_ID: Player::getPlatformOnlineId
PStrRespawnPos 10 PStrRespawnPos is 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.

PAct*

Name Value Description
PActSetAbility 0 PActSetAbility is 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.
PActCanUseAbility 1 PActCanUseAbility is PIER_PACT_CAN_USE_ABILITY: a=AbilitiesIndex β†’ out "0"/"1" Player::canUseAbility
PActSetSelectedSlot 2 PActSetSelectedSlot is PIER_PACT_SET_SELECTED_SLOT: a=slot Player::setSelectedSlot
PActGiveItem 3 PActGiveItem is PIER_PACT_GIVE_ITEM: sarg=item SNBT ItemStack::fromTag + Player::addAndRefresh
PActSetSpawnPoint 4 PActSetSpawnPoint is PIER_PACT_SET_SPAWN_POINT: a,b,c=pos, sarg=dim id (any registered dim); native Player::setRespawnPosition
PActClearTitle 5 PActClearTitle is PIER_PACT_CLEAR_TITLE: native SetTitlePacket(Clear)
PActSetTitle 6 PActSetTitle is PIER_PACT_SET_TITLE: sarg=text, a=slot(0 title,1 subtitle,2 actionbar); native SetTitlePacket, text sent verbatim
PActAddExperience 7 PActAddExperience is PIER_PACT_ADD_EXPERIENCE: a=xp Player::addExperience
PActAddLevels 8 PActAddLevels is PIER_PACT_ADD_LEVELS: a=levels Player::addLevels
PActStartCooldown 9 PActStartCooldown is PIER_PACT_START_COOLDOWN: sarg=item name, a=ticks Player::startItemCooldown
PActStartRiding 10 PActStartRiding is PIER_PACT_START_RIDING: a=vehicle ActorUniqueID (lower 64b) Player::startRiding
PActStopRiding 11 PActStopRiding is PIER_PACT_STOP_RIDING: Player::stopRiding
PActAttack 12 PActAttack is PIER_PACT_ATTACK: a=target ActorUniqueID (lower 64b) Player::attack
PActDrop 13 PActDrop is PIER_PACT_DROP: sarg=item SNBT, a=random(0/1) Player::drop
PActInteract 14 PActInteract is PIER_PACT_INTERACT: a=target ActorUniqueID Player::interact
PActStartUsingItem 15 PActStartUsingItem is PIER_PACT_START_USING_ITEM: sarg=item SNBT, a=duration Player::startUsingItem
PActStopUsingItem 16 PActStopUsingItem is PIER_PACT_STOP_USING_ITEM: Player::stopUsingItem
PActSetChunkRadius 17 PActSetChunkRadius is PIER_PACT_SET_CHUNK_RADIUS: a=radius Player::setChunkRadius
PActSetEnchantmentSeed 18 PActSetEnchantmentSeed is PIER_PACT_SET_ENCHANTMENT_SEED: a=seed Player::setEnchantmentSeed
PActRegisterTrackedBoss 19 PActRegisterTrackedBoss is PIER_PACT_REGISTER_TRACKED_BOSS: a=boss ActorUniqueID Player::registerTrackedBoss
PActUnregisterTrackedBoss 20 PActUnregisterTrackedBoss is PIER_PACT_UNREGISTER_TRACKED_BOSS: a=boss ActorUniqueID Player::unRegisterTrackedBoss
PActPlayEmote 21 PActPlayEmote is PIER_PACT_PLAY_EMOTE: sarg=piece id Player::playEmote
PActResendAllChunks 22 PActResendAllChunks is PIER_PACT_RESEND_ALL_CHUNKS: Player::resendAllChunks
PActOpenInventory 23 PActOpenInventory is PIER_PACT_OPEN_INVENTORY: Player::openInventory
PActSidebarSet 24 PActSidebarSet is PIER_PACT_SIDEBAR_SET: sarg="obj\ntitle\nline…" per-player sidebar
PActSidebarClear 25 PActSidebarClear is PIER_PACT_SIDEBAR_CLEAR: sarg=objective RemoveObjectivePacket
PActSetPermissionLevel 26 PActSetPermissionLevel is 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.