Interface IPlayer
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Represents a player
public interface IPlayer
- Extension Methods
Properties
ClientId
The players current client id, 0 if not connected. This is the number thats assigned by the server for any connecting player. You probably don't need this number.
int ClientId { get; }
Property Value
CurrentBlockSelection
The block the player is currently aiming at
BlockSelection CurrentBlockSelection { get; }
Property Value
CurrentEntitySelection
The entity the player is currently aiming at
EntitySelection CurrentEntitySelection { get; }
Property Value
Entitlements
List of the users entitlements, vanilla servers will list VIV and/or VS Team member entitlements
List<Entitlement> Entitlements { get; }
Property Value
Entity
The entity the player currently controls
EntityPlayer Entity { get; }
Property Value
Groups
The players player group memberships
PlayerGroupMembership[] Groups { get; }
Property Value
ImmersiveFpMode
bool ImmersiveFpMode { get; }
Property Value
InventoryManager
Returns the given players inventory manager that let's you do various interesting things with the players inventory.
IPlayerInventoryManager InventoryManager { get; }
Property Value
PlayerName
Get the players character name. The character name can be changed every 60 days in the account manager, so don't consider the players name as a unique identifier for a player. Use PlayerUID instead
string PlayerName { get; }
Property Value
PlayerUID
Returns the players identifier that is unique across all registered players and will never change. Use this to uniquely identify a player for all eternity. Shorthand for WorldData.PlayerUID
string PlayerUID { get; }
Property Value
Privileges
The list of privileges the player currently has access to (by role or direct assignment) This list is available for the playing player on the client, but not for other players.
string[] Privileges { get; }
Property Value
- string[]
Role
Returns the players privilege role
IPlayerRole Role { get; set; }
Property Value
WorldData
Some world-specific information about the player. This object is stored with the save game. If you modify it server side, be sure to call player.BroadcastPlayerData() to send it to affected clients.
IWorldPlayerData WorldData { get; }
Property Value
Methods
GetGroup(int)
Returns the membership data if player is part of this group, otherwise null
PlayerGroupMembership GetGroup(int groupId)
Parameters
groupId
int
Returns
GetGroups()
Load the players group that he is a member of
PlayerGroupMembership[] GetGroups()
Returns
HasPrivilege(string)
Check if a player has the given privilege
bool HasPrivilege(string privilegeCode)
Parameters
privilegeCode
stringThe privilege to check
Returns
- bool
true if the player has the given privilege, false otherwise