[This is preliminary documentation and is subject to change.]
The Player type exposes the following methods.
Methods
| Member | Description | |
|---|---|---|
| Bind(Block, Block) | ||
| Can(Permission) | Returns true if player has the given permission. | |
| Can(array<Permission>[]()[][]) | Returns true if player has ALL of the given permissions. | |
| Can(Permission, Rank) | Returns true if player has the given permission,
and is allowed to affect players of the given rank. | |
| CanAny(array<Permission>[]()[][]) | Returns true if player has ANY of the given permissions. | |
| CanDraw(Int32) | Returns true if player is allowed to run
draw commands that affect a given number of blocks. | |
| CanJoin(World) | Returns true if player is allowed to join a given world. | |
| CanPlace(Map, Vector3I, Block, BlockChangeContext) | Checks whether player is allowed to place a block on the current world at given coordinates.
Raises the PlayerPlacingBlock event. | |
| CanSee(Player) | Whether this player can currently see another player as being online.
Players can always see themselves. Super players (e.g. Console) can see all.
Hidden players can only be seen by those of sufficient rank. | |
| CanSee(World) | Whether this player should see a given world on the /Worlds list by default. | |
| CanSeeMoving(Player) | Whether this player can currently see another player moving.
Behaves very similarly to CanSee method, except when spectating:
Spectators and spectatee cannot see each other.
Spectators can only be seen by those who'd be able to see them hidden. | |
| CheckPaidStatus(String) | Checks whether a given player has a paid minecraft.net account. | |
| ClearLowPriotityOutputQueue()()()() | ||
| ClearPriorityOutputQueue()()()() | ||
| Confirm(CommandReader, String, array<Object>[]()[][]) | Request player to confirm continuing with the command.
Player is prompted to type "/ok", and when he/she does,
the command is called again with IsConfirmed flag set. | |
| Confirm(ConfirmationCallback, Object, String, array<Object>[]()[][]) | Request player to confirm an action.
Player is prompted to type "/ok", and when he/she does, custom callback will be called | |
| ContainsValidCharacters(String) | Ensures that a player name has the correct length and character set. | |
| DrawBegin(DrawOperation) | ||
| Equals(Object) | (Inherited from Object.) | |
| Finalize()()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
| GetBind(Block) | ||
| GetCopyInformation()()()() | ||
| GetHashCode()()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetType()()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| Ignore(PlayerInfo) | Adds a given PlayerInfo to the ignore list.
Not that ignores are not persistent, and are reset when a player disconnects. | |
| IsIgnoring(PlayerInfo) | Checks whether this player is currently ignoring a given PlayerInfo. | |
| IsValidName(String) | Ensures that a player name has the correct length and character set. | |
| JoinWorld(World, WorldChangeReason) | ||
| JoinWorld(World, WorldChangeReason, Position) | ||
| Kick(String, LeaveReason) | Kick (asynchronous). Immediately blocks all client input, but waits
until client thread has sent the kick packet. | |
| Kick(Player, String, LeaveReason, Boolean, Boolean, Boolean) | Advanced kick command. | |
| MemberwiseClone()()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| Message(String, array<Object>[]()[][]) | ||
| MessageInvalidPlayerName(String) | Prints "___ is not a valid player name" message. | |
| MessageInvalidWorldName(String) | Prints "Unacceptable world name" message, and requirements for world names. | |
| MessageManyMatches(String, IEnumerable<(Of <<'(IClassy>)>>)) | Prints a comma-separated list of matches (up to 30): "More than one ___ matched: ___, ___, ..." | |
| MessageMaxTimeSpan()()()() | Prints "Specify a time range up to ___" message | |
| MessageMuted()()()() | Prints "You are muted for ___ longer" message. | |
| MessageNoAccess(CommandDescriptor) | Prints "This command requires ___+ rank" message. | |
| MessageNoAccess(array<Permission>[]()[][]) | Prints "This command requires ___+ rank" message. | |
| MessageNoPlayer(String) | Prints "No players found matching ___" message. | |
| MessageNoRank(String) | Prints "Unrecognized rank ___" message. | |
| MessageNoWorld(String) | Prints "No worlds found matching ___" message. | |
| MessageNoZone(String) | Prints "No zones found matching ___" message. | |
| MessagePrefixed(String, String, array<Object>[]()[][]) | ||
| MessageUnsafePath()()()() | Prints "You cannot access files outside the map folder." message. | |
| MessageWoMAlert(String, array<Object>[]()[][]) | ||
| ParseMessage(String, Boolean) | Parses a message on behalf of this player. | |
| PlaceBlock(Vector3I, ClickAction, Block) | Handles manually-placed/deleted blocks.
Returns true if player's action should result in a kick. | |
| RedoClear()()()() | ||
| ResetAllBinds()()()() | ||
| ResetBind(Block) | ||
| ResetBind(array<Block>[]()[][]) | ||
| ResetIdleTimer()()()() | Resets the IdleTimer to 0. | |
| RevertBlock(Vector3I) | Gets the block from given location in player's world,
and sends it (async) to the player.
Used to undo player's attempted block placement/deletion. | |
| SelectionAddMark(Vector3I, Boolean) | ||
| SelectionCancel()()()() | ||
| SelectionExecute()()()() | ||
| SelectionResetMarks()()()() | ||
| SelectionStart(Int32, SelectionCallback, Object, array<Permission>[]()[][]) | ||
| Send(Packet) | Send packet (thread-safe, async, priority queue).
This is used for most packets (movement, chat, etc). | |
| SendBlock(Vector3I, Block) | Sends a block change to THIS PLAYER ONLY. Does not affect the map. | |
| SendLowPriority(Packet) | Send packet (thread-safe, asynchronous, delayed queue).
This is currently only used for block updates. | |
| SendNow(Packet) | Send packet to player (not thread safe, sync, immediate).
Should NEVER be used from any thread other than this session's ioThread.
Not thread-safe (for performance reason). | |
| SendToSpectators(String, array<Object>[]()[][]) | Sends a message to all players who are spectating this player, e.g. to forward typed-in commands and PMs. | |
| SetCopyInformation(CopyState) | ||
| Spectate(Player) | ||
| StopSpectating()()()() | ||
| TeleportTo(Position) | Teleports player to a given coordinate within this map. | |
| ToString()()()() | Name formatted for the debugger. (Overrides Object..::..ToString()()()().) | |
| UndoClear()()()() | ||
| UndoPop()()()() | ||
| Unignore(PlayerInfo) | Removes a given PlayerInfo from the ignore list. | |
| WaitForDisconnect()()()() | Blocks the calling thread until this session disconnects. |