BedrockPlayer

Undocumented in source.

Constructors

this
this(PlayerInfo info, World world, EntityPosition position)
Undocumented in source.

Members

Functions

disconnectImpl
void disconnectImpl(Translation translation)
Undocumented in source. Be warned that the author may not have intended to support it.
encodeServerMessage
string encodeServerMessage(Message[] messages)

Encodes a Message[] into a string that can be parsed by the client. Every instance of Translation is translated server-side.

handleBlockBreaking
bool handleBlockBreaking()
Undocumented in source. Be warned that the author may not have intended to support it.
registerCommand
Command registerCommand(Command command)
Undocumented in source. Be warned that the author may not have intended to support it.
sendCommands
void sendCommands()
Undocumented in source.
sendMessageImpl
void sendMessageImpl(Message[] messages)

Creates a string message that can be displayed by the client.

sendRawMessageImpl
void sendRawMessageImpl(string message)
Undocumented in source.
sendTranslationMessageImpl
void sendTranslationMessageImpl(string message, string[] params)
Undocumented in source.
unregisterCommand
bool unregisterCommand(Command command)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

deviceModel
string deviceModel [@property getter]

Gets the player's device model (name and identifier) as indicated by the client in the login packet.

deviceOs
DeviceOS deviceOs [@property getter]

Gets the player's operative system, as indicated by the client in the login packet.

operator
bool operator [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
xuid
long xuid [@property getter]

Gets the player's XBOX user id. It's always the same value for the same user, if authenticated. It's 0 if the server is not in online mode. This value can be used to retrieve more informations about the player using the XBOX live services.

Static functions

updateResourcePacks
void updateResourcePacks(UUID uuid, void[] rp)
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

resourcePackChunks
ubyte[][] resourcePackChunks;
Undocumented in source.
resourcePackHash
string resourcePackHash;
Undocumented in source.
resourcePackId
string resourcePackId;
Undocumented in source.
resourcePackSize
size_t resourcePackSize;
Undocumented in source.

Variables

send_commands
bool send_commands;
Undocumented in source.

Inherited Members

From Player

info
PlayerInfo info;
Undocumented in source.
gameId
ubyte gameId;
Undocumented in source.
chatName
string chatName;
Undocumented in source.
connectedSameMachine
bool connectedSameMachine;
connectedSameNetwork
bool connectedSameNetwork;
Undocumented in source.
viewDistance
size_t viewDistance;
Undocumented in source.
loaded_chunks
ChunkPosition[] loaded_chunks;
Undocumented in source.
last_chunk_update
tick_t last_chunk_update;
Undocumented in source.
last_chunk_position
ChunkPosition last_chunk_position;
Undocumented in source.
chunksUntilSpawn
size_t chunksUntilSpawn;
Undocumented in source.
breaking
BlockPosition breaking;
Undocumented in source.
is_breaking
bool is_breaking;
Undocumented in source.
updateInventoryToViewers
bool updateInventoryToViewers;
Undocumented in source.
updateArmorToViewers
bool updateArmorToViewers;
Undocumented in source.
joined
bool joined;
Undocumented in source.
hasResourcePack
bool hasResourcePack;
Undocumented in source.
close
void close()
Undocumented in source. Be warned that the author may not have intended to support it.
hubId
uint hubId [@property getter]

Gets the player's hub id. It will always be the same for the same player even when it is transferred to another world or another node without leaving the server.

address
Address address [@property getter]
ip
string ip [@property getter]
port
ushort port [@property getter]

Gets the player's connection informations.

usedIp
string usedIp [@property getter]
usedPort
ushort usedPort [@property getter]

Gets the ip and the port the player has used to join the server.

name
string name [@property getter]

Gets the player's raw name conserving the original upper-lowercase format.

lname
string lname [@property getter]

Gets the player's username converted to lowercase.

displayName
string displayName [@property getter]
string displayName [@property setter]

Edits the player's displayed name, as it appears in the server's players list (it can be coloured). It can be edited on PlayerPreLoginEvent.

localDisplayName
string localDisplayName [@property setter]

Updates the display name but only for the current world and children/parents. When the player is transferred to another node or to another group of world the display name is resetted.

protocol
uint protocol [@property getter]

Gets the player's game protocol.

game
string game [@property getter]

Gets the player's game.

gameName
string gameName [@property getter]

Gets the player's game name.

gameVersion
string gameVersion [@property getter]

Gets the player's game version.

online
bool online [@property getter]

Indicates whether or not the player is still connected to the node.

language
string language [@property getter]

Gets the language of the player. The string will be in the Settings.ACCEPTED_LANGUAGES array, as indicated in the hub's configuration file.

lang
deprecated alias lang = language
Undocumented in source.
edu
bool edu [@property getter]

Indicates whether or not the player is using Minecraft: Education Edition.

inputMode
InputMode inputMode [@property getter]

Gets the player's input mode.

latency
uint latency [@property getter]
ping
deprecated alias ping = latency

Gets the player's latency (in milliseconds), calculated adding the latency from the client to the hub and the latency from the hub and the current node. For pocket edition players it's calculated through an UDP protocol and may not be accurate.

packetLoss
float packetLoss [@property getter]

Gets the player's packet loss, if the client is connected through and UDP protocol.

tick
void tick()
Undocumented in source. Be warned that the author may not have intended to support it.
server
shared(NodeServer) server [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
world
World world [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
world
World world [@property setter]

Teleports the player to another world.

attackImpl
void attackImpl(EntityDamageEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
die
void die()
Undocumented in source. Be warned that the author may not have intended to support it.
firstspawn
void firstspawn()
Undocumented in source. Be warned that the author may not have intended to support it.
sendMessageImpl
void sendMessageImpl(Message[] messages)
Undocumented in source.
sendTip
void sendTip(E args)
tip
alias tip = sendTip

Sends a tip message that will be displayed above the hotbar for two seconds before fading out.

sendTitle
void sendTitle(Title title, Subtitle subtitle, uint fadeIn, uint stay, uint fadeOut)
void sendTitle(Title title, uint fadeIn, uint stay, uint fadeOut)
void sendTitle(string title, string subtitle, uint fadeIn, uint stay, uint fadeOut)

Sends a title message that will be displayed at the centre of the screen. The Title struct can be used to control the title message, the subtitle and the timing for the animations (fade in, stay and fade out).

hideTitle
void hideTitle()

Hides the title displayed with the title property without resetting it.

clearTitle
void clearTitle()
resetTitle
alias resetTitle = clearTitle

Removes the title displayed with the title property.

sendMovements
void sendMovements()
Undocumented in source. Be warned that the author may not have intended to support it.
consumeTools
bool consumeTools [@property getter]

Boolean values indicating whether or not the player's tools should be consumed when used.

permissionLevel
PermissionLevel permissionLevel [@property getter]

Gets the player's permission level.

permissionLevel
PermissionLevel permissionLevel [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
operator
bool operator [@property getter]

Indicates whether the player has a permission level higher or equals than 1 (operator).

operator
bool operator [@property setter]

If the player has a permission level or 0 (user), sets it to 1 (operator).

op
alias op = operator
Undocumented in source.
grantPermission
bool grantPermission(string permission)

Grants a permission.

revokePermission
bool revokePermission(string permission)

Revokes a permission.

hasPermission
bool hasPermission(string permission)

Indicates whether the player has the given permission.

permissions
string[] permissions [@property getter]

Gets a list of the player's permissions.

gamemode
ubyte gamemode [@property getter]
survival
bool survival [@property getter]
creative
bool creative [@property getter]
adventure
bool adventure [@property getter]
spectator
bool spectator [@property getter]

Gets the player's gamemode.

gamemode
ubyte gamemode [@property setter]
survival
bool survival [@property setter]
creative
bool creative [@property setter]
adventure
bool adventure [@property setter]
spectator
bool spectator [@property setter]

Sets the player's gamemode.

disconnect
void disconnect(Translation reason)
void disconnect(string reason)

Disconnects the player from the server (from both the node and the hub). The reason can be a Translation.

disconnectImpl
void disconnectImpl(Translation )
Undocumented in source.
transfer
void transfer(Node node)

Transfers the player in another node. The target node should be in server.nodes, otherwise the player will be disconnected by the hub with "End of Stream" message.

transfer
void transfer(string ip, ushort port)

Transfers a player to given server and port if the client has the functionality to do so. Calling this method will not disconnect the player immediately.

openContainer
void openContainer(Container container, BlockPosition position)
Undocumented in source. Be warned that the author may not have intended to support it.
container
Container container [@property getter]

Returns the the current container the player is viewing.

closeContainer
void closeContainer()
Undocumented in source. Be warned that the author may not have intended to support it.
show
bool show(Entity entity)
Undocumented in source. Be warned that the author may not have intended to support it.
hide
bool hide(Entity entity)
Undocumented in source. Be warned that the author may not have intended to support it.
spawnToItself
void spawnToItself()
Undocumented in source.
spawn
EntityPosition spawn [@property setter]
BlockPosition spawn [@property setter]

Sets the player's spawn point.

respawn
void respawn()
Undocumented in source. Be warned that the author may not have intended to support it.
teleport
void teleport(EntityPosition position)
Undocumented in source. Be warned that the author may not have intended to support it.
teleport
void teleport(World world, EntityPosition position)
Undocumented in source. Be warned that the author may not have intended to support it.
motion
EntityPosition motion [@property setter]

Sets the motion and let the client do its physic actions.

broadcastMetadata
void broadcastMetadata()
Undocumented in source. Be warned that the author may not have intended to support it.
callDeathEvent
EntityDeathEvent callDeathEvent(EntityDamageEvent last)
Undocumented in source. Be warned that the author may not have intended to support it.
callCommand
void callCommand(string command)

Calls a command from a string.

registerCommand
Command registerCommand(Command _command)

Adds a new command using a command-container class.

unregisterCommand
bool unregisterCommand(Command command)
bool unregisterCommand(string command)

Removes a command using the command class given in registerCommand.

updateAvailableCommands
void updateAvailableCommands()
Undocumented in source. Be warned that the author may not have intended to support it.
availableCommands
Command[string] availableCommands [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
position
EntityPosition position()
Undocumented in source. Be warned that the author may not have intended to support it.
visibleEntities
Entity[] visibleEntities()
Undocumented in source. Be warned that the author may not have intended to support it.
visiblePlayers
Player[] visiblePlayers()
Undocumented in source. Be warned that the author may not have intended to support it.
onCollect
bool onCollect(Collectable collectable)
Undocumented in source. Be warned that the author may not have intended to support it.
sendMovementUpdates
void sendMovementUpdates(Entity[] entities)
Undocumented in source.
sendMotionUpdates
void sendMotionUpdates(Entity[] entities)
Undocumented in source.
sendCompletedMessages
void sendCompletedMessages(string[] messages)
Undocumented in source.
sendTipImpl
void sendTipImpl(Message[] messages)
Undocumented in source.
sendTitleImpl
void sendTitleImpl(Title title, Subtitle subtitle, uint fadeIn, uint stay, uint fadeOut)
Undocumented in source.
sendHideTitles
void sendHideTitles()
Undocumented in source.
sendResetTitles
void sendResetTitles()
Undocumented in source.
sendGamemode
void sendGamemode()
Undocumented in source.
sendOpenContainer
void sendOpenContainer(ubyte type, ushort slots, BlockPosition position)
Undocumented in source.
sendAddList
void sendAddList(Player[] players)
Undocumented in source.
sendUpdateLatency
void sendUpdateLatency(Player[] players)
Undocumented in source.
sendRemoveList
void sendRemoveList(Player[] players)
Undocumented in source.
sendSpawnPosition
void sendSpawnPosition()
Undocumented in source.
sendPosition
void sendPosition()
Undocumented in source.
sendMotion
void sendMotion(EntityPosition motion)
Undocumented in source.
sendSpawnEntity
void sendSpawnEntity(Entity entity)
Undocumented in source.
sendDespawnEntity
void sendDespawnEntity(Entity entity)
Undocumented in source.
sendMetadata
void sendMetadata(Entity entity)
Undocumented in source.
sendChunk
void sendChunk(Chunk chunk)
Undocumented in source.
unloadChunk
void unloadChunk(ChunkPosition pos)
Undocumented in source.
sendChangeDimension
void sendChangeDimension(Dimension from, Dimension to)
Undocumented in source.
sendInventory
void sendInventory(ubyte flag, bool[] slots)
Undocumented in source.
sendHeld
void sendHeld()
Undocumented in source.
sendEntityEquipment
void sendEntityEquipment(Player player)
Undocumented in source.
sendArmorEquipment
void sendArmorEquipment(Player player)
Undocumented in source.
sendHurtAnimation
void sendHurtAnimation(Entity entity)
Undocumented in source.
sendDeathAnimation
void sendDeathAnimation(Entity entity)
Undocumented in source.
sendDeathSequence
void sendDeathSequence()
Undocumented in source.
experienceUpdated
void experienceUpdated()
Undocumented in source.
sendJoinPacket
void sendJoinPacket()
Undocumented in source.
sendResourcePack
void sendResourcePack()
Undocumented in source.
sendPermissionLevel
void sendPermissionLevel(PermissionLevel )
Undocumented in source.
sendDifficulty
void sendDifficulty(Difficulty )
Undocumented in source.
sendWorldGamemode
void sendWorldGamemode(Gamemode )
Undocumented in source.
sendDoDaylightCycle
void sendDoDaylightCycle(bool )
Undocumented in source.
sendTime
void sendTime(uint )
Undocumented in source.
sendWeather
void sendWeather(bool , bool , uint , uint )
Undocumented in source.
sendSettingsPacket
void sendSettingsPacket()
Undocumented in source.
sendRespawnPacket
void sendRespawnPacket()
Undocumented in source.
setAsReadyToSpawn
void setAsReadyToSpawn()
Undocumented in source.
sendLightning
void sendLightning(Lightning lightning)
Undocumented in source.
sendAnimation
void sendAnimation(Entity entity)
Undocumented in source.
sendBlock
void sendBlock(PlacedBlock block)
Undocumented in source. Be warned that the author may not have intended to support it.
sendBlocks
void sendBlocks(PlacedBlock[] block)
Undocumented in source.
sendTile
void sendTile(Tile tiles, bool translatable)
Undocumented in source.
sendPickupItem
void sendPickupItem(Entity picker, Entity picked)
Undocumented in source.
sendPassenger
void sendPassenger(ubyte mode, uint passenger, uint vehicle)
Undocumented in source.
sendExplosion
void sendExplosion(EntityPosition position, float radius, Vector3!byte[] updates)
Undocumented in source.
sendMap
void sendMap(Map map)
Undocumented in source.
sendMusic
void sendMusic(EntityPosition position, ubyte instrument, uint pitch)
Undocumented in source.
handleCompleteMessage
void handleCompleteMessage(string message, bool assumeCommand)

Completes the command args (or the command itself) if the arg type is an enum or a player (the ones in the world's list are sent), even if they are not spawned or visible to the player.

handleTextMessage
void handleTextMessage(string message)
Undocumented in source. Be warned that the author may not have intended to support it.
handleMovementPacket
void handleMovementPacket(EntityPosition position, float yaw, float bodyYaw, float pitch)
Undocumented in source. Be warned that the author may not have intended to support it.
handleStartBlockBreaking
bool handleStartBlockBreaking(BlockPosition position)
Undocumented in source. Be warned that the author may not have intended to support it.
handleAbortBlockBreaking
void handleAbortBlockBreaking()
Undocumented in source. Be warned that the author may not have intended to support it.
handleBlockBreaking
bool handleBlockBreaking()
Undocumented in source. Be warned that the author may not have intended to support it.
handleBlockPlacing
void handleBlockPlacing(BlockPosition tpos, uint tface)
Undocumented in source. Be warned that the author may not have intended to support it.
handleArmSwing
void handleArmSwing()
Undocumented in source. Be warned that the author may not have intended to support it.
handleAttack
void handleAttack(uint entity)
Undocumented in source. Be warned that the author may not have intended to support it.
handleAttack
void handleAttack(Entity entity)
Undocumented in source. Be warned that the author may not have intended to support it.
handleInteract
void handleInteract(uint entity)
Undocumented in source. Be warned that the author may not have intended to support it.
handleInteract
void handleInteract(Entity entity)
Undocumented in source. Be warned that the author may not have intended to support it.
handleReleaseItem
void handleReleaseItem()
Undocumented in source. Be warned that the author may not have intended to support it.
handleStopSleeping
void handleStopSleeping()
Undocumented in source. Be warned that the author may not have intended to support it.
handleRespawn
void handleRespawn()
Undocumented in source. Be warned that the author may not have intended to support it.
handleJump
void handleJump()
Undocumented in source. Be warned that the author may not have intended to support it.
handleSprinting
void handleSprinting(bool sprint)
Undocumented in source. Be warned that the author may not have intended to support it.
handleSneaking
void handleSneaking(bool sneak)
Undocumented in source. Be warned that the author may not have intended to support it.
handleChangeDimension
void handleChangeDimension()
Undocumented in source. Be warned that the author may not have intended to support it.
consumeItemInHand
bool consumeItemInHand()
Undocumented in source. Be warned that the author may not have intended to support it.
handleRightClick
void handleRightClick(BlockPosition tpos, uint tface)
Undocumented in source. Be warned that the author may not have intended to support it.
handleMapRequest
void handleMapRequest(ushort mapId)
Undocumented in source. Be warned that the author may not have intended to support it.
handleDrop
bool handleDrop(Slot slot)
Undocumented in source. Be warned that the author may not have intended to support it.
order
uint order;
Undocumented in source.
handle
void handle(ubyte id, ubyte[] data)
Undocumented in source.
flush
void flush()
Undocumented in source.
sendPacketPayload
void sendPacketPayload(ubyte[] payload)
Undocumented in source. Be warned that the author may not have intended to support it.
startCompression
void startCompression(uint hubId)
Undocumented in source. Be warned that the author may not have intended to support it.
stopCompression
void stopCompression()
Undocumented in source. Be warned that the author may not have intended to support it.
compress
void compress(ubyte[] payload)
Undocumented in source. Be warned that the author may not have intended to support it.
Compression
class Compression
Undocumented in source.

Meta