Class OpenPlayer
The Player class used for all Players connected to an OpenAPI server.
Inheritance
System.Object
OpenPlayer
Implements
OpenAPI.Locale.ILocaleReceiver
OpenAPI.Locale.ILocalizable
Assembly: OpenAPI.dll
Syntax
public class OpenPlayer : MiNET.Player, ILocaleReceiver, ILocalizable
Constructors
|
Improve this Doc
View Source
OpenPlayer(OpenServer, IPEndPoint, OpenApi)
Declaration
public OpenPlayer(OpenServer server, IPEndPoint endPoint, OpenApi api)
Parameters
Type |
Name |
Description |
OpenServer |
server |
The server instance the player connected through
|
IPEndPoint |
endPoint |
The player's remote endpoint
|
OpenApi |
api |
An instance of the API
|
Fields
|
Improve this Doc
View Source
Declaration
public bool CapturePlayerInputMode
Field Value
Type |
Description |
System.Boolean |
|
Properties
|
Improve this Doc
View Source
Culture
The player's culture info, can be used for localization purposes
Declaration
public CultureInfo Culture { get; }
Property Value
Type |
Description |
CultureInfo |
|
|
Improve this Doc
View Source
Disguise
Can be used to Disguise a player into any Entity. See EntityDisguise and
Can be undone by setting the value to null.
Declaration
public EntityDisguise Disguise { get; set; }
Property Value
|
Improve this Doc
View Source
EventDispatcher
The EventDispatcher that can be used to listen to any events for this player.
Declaration
public EventDispatcher EventDispatcher { get; }
Property Value
|
Improve this Doc
View Source
IsDisguised
Whether the player is currently Disguised using the Disguise property
Declaration
public bool IsDisguised { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsXbox
Returns true if player is authenticated with an online-mode account
Declaration
public bool IsXbox { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Level
The OpenLevel instance the player is currently in.
Declaration
public OpenLevel Level { get; }
Property Value
|
Improve this Doc
View Source
Permissions
Declaration
public PermissionManager Permissions { get; }
Property Value
Methods
|
Improve this Doc
View Source
AcceptPlayerMove(McpeMovePlayer, Boolean, Boolean)
Declaration
protected override bool AcceptPlayerMove(McpeMovePlayer message, bool isOnGround, bool isFlyingHorizontally)
Parameters
Type |
Name |
Description |
McpeMovePlayer |
message |
|
System.Boolean |
isOnGround |
|
System.Boolean |
isFlyingHorizontally |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DespawnFromPlayers(MiNET.Player[])
Declaration
public override void DespawnFromPlayers(MiNET.Player[] players)
Parameters
Type |
Name |
Description |
MiNET.Player[] |
players |
|
|
Improve this Doc
View Source
DespawnFromPlayers(Boolean, OpenPlayer[])
Despawns the player from other players
Declaration
public void DespawnFromPlayers(bool forced = true, params OpenPlayer[] players)
Parameters
Type |
Name |
Description |
System.Boolean |
forced |
If true, force despawns even if disguised
|
OpenPlayer[] |
players |
The players to despawn from
|
|
Improve this Doc
View Source
GetAttribute<TAttribute>()
Declaration
public TAttribute GetAttribute<TAttribute>()
where TAttribute : class, IOpenPlayerAttribute
Returns
Type |
Description |
TAttribute |
The value for the requested attribute, or null if no value was found.
|
Type Parameters
Name |
Description |
TAttribute |
The attribute type to retrieve its value for
|
|
Improve this Doc
View Source
GetInvItem(Int32, Int32)
Declaration
public Item GetInvItem(int inventoryId, int slot)
Parameters
Type |
Name |
Description |
System.Int32 |
inventoryId |
|
System.Int32 |
slot |
|
Returns
|
Improve this Doc
View Source
HandleItemReleaseTransaction(ItemReleaseTransaction)
Declaration
protected override void HandleItemReleaseTransaction(ItemReleaseTransaction transaction)
Parameters
Type |
Name |
Description |
ItemReleaseTransaction |
transaction |
|
|
Improve this Doc
View Source
HandleItemUseOnEntityTransaction(ItemUseOnEntityTransaction)
Declaration
protected override void HandleItemUseOnEntityTransaction(ItemUseOnEntityTransaction transaction)
Parameters
Type |
Name |
Description |
ItemUseOnEntityTransaction |
transaction |
|
|
Improve this Doc
View Source
HandleItemUseTransaction(ItemUseTransaction)
Declaration
protected override void HandleItemUseTransaction(ItemUseTransaction transaction)
Parameters
Type |
Name |
Description |
ItemUseTransaction |
transaction |
|
|
Improve this Doc
View Source
HandleMcpeAdventureSettings(McpeAdventureSettings)
Declaration
public override void HandleMcpeAdventureSettings(McpeAdventureSettings message)
Parameters
Type |
Name |
Description |
McpeAdventureSettings |
message |
|
|
Improve this Doc
View Source
HandleMcpeBlockEntityData(McpeBlockEntityData)
Declaration
public override void HandleMcpeBlockEntityData(McpeBlockEntityData message)
Parameters
Type |
Name |
Description |
McpeBlockEntityData |
message |
|
|
Improve this Doc
View Source
HandleMcpeCommandRequest(McpeCommandRequest)
Handles any incoming commands.
Declaration
public override void HandleMcpeCommandRequest(McpeCommandRequest message)
Parameters
Type |
Name |
Description |
McpeCommandRequest |
message |
|
|
Improve this Doc
View Source
HandleMcpeInteract(McpeInteract)
Declaration
public override void HandleMcpeInteract(McpeInteract message)
Parameters
Type |
Name |
Description |
McpeInteract |
message |
|
|
Improve this Doc
View Source
HandleMcpeInventoryTransaction(McpeInventoryTransaction)
Declaration
public override void HandleMcpeInventoryTransaction(McpeInventoryTransaction message)
Parameters
Type |
Name |
Description |
McpeInventoryTransaction |
message |
|
|
Improve this Doc
View Source
HandleMcpePlayerAction(McpePlayerAction)
Declaration
public override void HandleMcpePlayerAction(McpePlayerAction message)
Parameters
Type |
Name |
Description |
McpePlayerAction |
message |
|
|
Improve this Doc
View Source
Handles player input, so we can determine what buttons are pressed by the client.
Declaration
public override void HandleMcpePlayerInput(McpePlayerInput message)
Parameters
Type |
Name |
Description |
McpePlayerInput |
message |
|
|
Improve this Doc
View Source
HandleMcpeResourcePackChunkRequest(McpeResourcePackChunkRequest)
Declaration
public override void HandleMcpeResourcePackChunkRequest(McpeResourcePackChunkRequest message)
Parameters
Type |
Name |
Description |
McpeResourcePackChunkRequest |
message |
|
|
Improve this Doc
View Source
HandleMcpeResourcePackClientResponse(McpeResourcePackClientResponse)
Declaration
public override void HandleMcpeResourcePackClientResponse(McpeResourcePackClientResponse message)
Parameters
Type |
Name |
Description |
McpeResourcePackClientResponse |
message |
|
|
Improve this Doc
View Source
HandleMcpeSetPlayerGameType(McpeSetPlayerGameType)
Declaration
public override void HandleMcpeSetPlayerGameType(McpeSetPlayerGameType message)
Parameters
Type |
Name |
Description |
McpeSetPlayerGameType |
message |
|
|
Improve this Doc
View Source
HandleMcpeText(McpeText)
Handles incoming chat messages
Declaration
public override void HandleMcpeText(McpeText message)
Parameters
Type |
Name |
Description |
McpeText |
message |
|
|
Improve this Doc
View Source
HandleNormalTransaction(NormalTransaction)
Declaration
protected override void HandleNormalTransaction(NormalTransaction normal)
Parameters
Type |
Name |
Description |
NormalTransaction |
normal |
|
|
Improve this Doc
View Source
HandleTransactionRecords(List<TransactionRecord>)
Declaration
protected override void HandleTransactionRecords(List<TransactionRecord> records)
Parameters
Type |
Name |
Description |
List<TransactionRecord> |
records |
|
|
Improve this Doc
View Source
InitializePlayer()
Declaration
public override void InitializePlayer()
|
Improve this Doc
View Source
OnPlayerJoin(PlayerEventArgs)
Declaration
protected override void OnPlayerJoin(PlayerEventArgs e)
Parameters
Type |
Name |
Description |
PlayerEventArgs |
e |
|
|
Improve this Doc
View Source
OnPlayerJoining(PlayerEventArgs)
Declaration
protected override void OnPlayerJoining(PlayerEventArgs e)
Parameters
Type |
Name |
Description |
PlayerEventArgs |
e |
|
|
Improve this Doc
View Source
OnPlayerLeave(PlayerEventArgs)
Declaration
protected override void OnPlayerLeave(PlayerEventArgs e)
Parameters
Type |
Name |
Description |
PlayerEventArgs |
e |
|
|
Improve this Doc
View Source
OnTicked(PlayerEventArgs)
Declaration
protected override void OnTicked(PlayerEventArgs e)
Parameters
Type |
Name |
Description |
PlayerEventArgs |
e |
|
|
Improve this Doc
View Source
OnTicking(PlayerEventArgs)
Declaration
protected override void OnTicking(PlayerEventArgs e)
Parameters
Type |
Name |
Description |
PlayerEventArgs |
e |
|
|
Improve this Doc
View Source
RefreshCommands()
Declaration
public void RefreshCommands()
|
Improve this Doc
View Source
SendAvailableCommands()
Sends the players available command set
Declaration
protected override void SendAvailableCommands()
|
Improve this Doc
View Source
SendLocalizedMessage(String, MessageType, MiNET.Player)
Declaration
public void SendLocalizedMessage(string text, MessageType type = null, MiNET.Player sender = null)
Parameters
Type |
Name |
Description |
System.String |
text |
|
MessageType |
type |
|
MiNET.Player |
sender |
|
|
Improve this Doc
View Source
SendLocalizedMessage(String, Object[], MessageType, MiNET.Player)
Declaration
public void SendLocalizedMessage(string text, object[] parameters = null, MessageType type = null, MiNET.Player sender = null)
Parameters
Type |
Name |
Description |
System.String |
text |
|
System.Object[] |
parameters |
|
MessageType |
type |
|
MiNET.Player |
sender |
|
|
Improve this Doc
View Source
SendLocalizedTitle(String, Object[], TitleType, Int32, Int32, Int32, MiNET.Player)
Declaration
public void SendLocalizedTitle(string text, object[] parameters = null, TitleType type = null, int fadeIn = 6, int fadeOut = 6, int stayTime = 20, MiNET.Player sender = null)
Parameters
Type |
Name |
Description |
System.String |
text |
|
System.Object[] |
parameters |
|
TitleType |
type |
|
System.Int32 |
fadeIn |
|
System.Int32 |
fadeOut |
|
System.Int32 |
stayTime |
|
MiNET.Player |
sender |
|
|
Improve this Doc
View Source
SendLocalizedTitle(String, TitleType, Int32, Int32, Int32, MiNET.Player)
Declaration
public void SendLocalizedTitle(string text, TitleType type = null, int fadeIn = 6, int fadeOut = 6, int stayTime = 20, MiNET.Player sender = null)
Parameters
Type |
Name |
Description |
System.String |
text |
|
TitleType |
type |
|
System.Int32 |
fadeIn |
|
System.Int32 |
fadeOut |
|
System.Int32 |
stayTime |
|
MiNET.Player |
sender |
|
|
Improve this Doc
View Source
SendResourcePacksInfo()
Declaration
public override void SendResourcePacksInfo()
|
Improve this Doc
View Source
SendResourcePackStack()
Declaration
public override void SendResourcePackStack()
|
Improve this Doc
View Source
SetAttribute<TAttribute>(TAttribute)
Declaration
public void SetAttribute<TAttribute>(TAttribute attribute)
where TAttribute : class, IOpenPlayerAttribute
Parameters
Type |
Name |
Description |
TAttribute |
attribute |
The value to set the attribute to
|
Type Parameters
Name |
Description |
TAttribute |
The type of the attribute you wish to set.
|
|
Improve this Doc
View Source
SetGamemode(GameMode)
Set's the players gamemode to the specified gamemode
Declaration
public void SetGamemode(GameMode gameMode)
Parameters
Type |
Name |
Description |
GameMode |
gameMode |
The gamemode to set for the player
|
|
Improve this Doc
View Source
SetInvItem(Int32, Int32, Item)
Declaration
public void SetInvItem(int inventoryId, int slot, Item item)
Parameters
Type |
Name |
Description |
System.Int32 |
inventoryId |
|
System.Int32 |
slot |
|
Item |
item |
|
|
Improve this Doc
View Source
SpawnToPlayers(MiNET.Player[])
Declaration
public override void SpawnToPlayers(MiNET.Player[] players)
Parameters
Type |
Name |
Description |
MiNET.Player[] |
players |
|
|
Improve this Doc
View Source
SpawnToPlayers(Boolean, OpenPlayer[])
Spawns the player from other players
Declaration
public void SpawnToPlayers(bool forced = true, params OpenPlayer[] players)
Parameters
Type |
Name |
Description |
System.Boolean |
forced |
If true, force spawns even if disguised
|
OpenPlayer[] |
players |
The players to spawn for
|
|
Improve this Doc
View Source
Teleport(PlayerLocation)
Teleports the player to specified position
Declaration
public override void Teleport(PlayerLocation newPosition)
Parameters
Type |
Name |
Description |
PlayerLocation |
newPosition |
The position to teleport the player to
|
|
Improve this Doc
View Source
TransferToServer(IPEndPoint)
Transfers the player to a different server
Note, only supports IPv4 addresses
Declaration
public void TransferToServer(IPEndPoint endpoint)
Parameters
Type |
Name |
Description |
IPEndPoint |
endpoint |
The endpoint to transfer to
|
Implements
OpenAPI.Locale.ILocaleReceiver
OpenAPI.Locale.ILocalizable