OpenMod Docs OpenMod Docs
OpenMod Docs OpenMod Docs
OpenMod .NET Plugin Framework.

Class UnturnedPlayer

Inheritance
System.Object
UnturnedPlayer
Implements
IPlayer
IEntity
IGameObject
IHasHealth
IHasInventory
ICanEnterVehicle
IDamageSource
IHasHunger
IHasThirst
Namespace: OpenMod.Unturned.Players
Assembly: OpenMod.Unturned.dll
Syntax
public class UnturnedPlayer : IEquatable<UnturnedPlayer>, IPlayer, IEntity, IGameObject, IHasHealth, IHasInventory, ICanEnterVehicle, IDamageSource, IHasHunger, IHasThirst

Constructors

| Improve this Doc View Source

UnturnedPlayer(Player)

Declaration
protected UnturnedPlayer(Player player)
Parameters
Type Name Description
Player player

Properties

| Improve this Doc View Source

Address

Declaration
public IPAddress? Address { get; }
Property Value
Type Description
System.Nullable<IPAddress>
| Improve this Doc View Source

Asset

Declaration
public IEntityAsset Asset { get; }
Property Value
Type Description
IEntityAsset
| Improve this Doc View Source

CurrentVehicle

Gets the current vehicle. Returns null if the player is not a passenger.

Declaration
public UnturnedVehicle CurrentVehicle { get; }
Property Value
Type Description
UnturnedVehicle
| Improve this Doc View Source

DamageSourceName

Declaration
public string DamageSourceName { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

EntityInstanceId

Declaration
public string EntityInstanceId { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Health

Declaration
public double Health { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Hunger

Declaration
public double Hunger { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Inventory

Gets the inventory of the player.

Declaration
public UnturnedPlayerInventory Inventory { get; }
Property Value
Type Description
UnturnedPlayerInventory
| Improve this Doc View Source

IsAlive

Declaration
public bool IsAlive { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

MaxHealth

Declaration
public double MaxHealth { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

MaxHunger

Declaration
public double MaxHunger { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

MaxThirst

Declaration
public double MaxThirst { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Player

Declaration
public Player Player { get; }
Property Value
Type Description
Player
| Improve this Doc View Source

PlayerLife

Declaration
public PlayerLife PlayerLife { get; }
Property Value
Type Description
PlayerLife
| Improve this Doc View Source

Stance

Declaration
public string Stance { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

State

Declaration
public IEntityState State { get; }
Property Value
Type Description
IEntityState
| Improve this Doc View Source

SteamId

Declaration
public CSteamID SteamId { get; }
Property Value
Type Description
CSteamID
| Improve this Doc View Source

SteamPlayer

Declaration
public SteamPlayer SteamPlayer { get; }
Property Value
Type Description
SteamPlayer
| Improve this Doc View Source

Thirst

Declaration
public double Thirst { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Transform

Declaration
public IWorldTransform Transform { get; }
Property Value
Type Description
IWorldTransform

Methods

| Improve this Doc View Source

DamageAsync(Double)

Declaration
public Task DamageAsync(double amount)
Parameters
Type Name Description
System.Double amount
Returns
Type Description
Task
| Improve this Doc View Source

Equals(UnturnedPlayer)

Declaration
public bool Equals(UnturnedPlayer other)
Parameters
Type Name Description
UnturnedPlayer other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Nullable<Object>)

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
| Improve this Doc View Source

KillAsync()

Declaration
public Task KillAsync()
Returns
Type Description
Task
| Improve this Doc View Source

PrintMessageAsync(String)

Declaration
public Task PrintMessageAsync(string message)
Parameters
Type Name Description
System.String message
Returns
Type Description
Task
| Improve this Doc View Source

PrintMessageAsync(String, Color)

Declaration
public Task PrintMessageAsync(string message, Color color)
Parameters
Type Name Description
System.String message
Color color
Returns
Type Description
Task
| Improve this Doc View Source

PrintMessageAsync(String, Color, Boolean, String)

Declaration
public Task PrintMessageAsync(string message, Color color, bool isRich, string iconUrl)
Parameters
Type Name Description
System.String message
Color color
System.Boolean isRich
System.String iconUrl
Returns
Type Description
Task
| Improve this Doc View Source

SetFullHealthAsync()

Declaration
public Task SetFullHealthAsync()
Returns
Type Description
Task
| Improve this Doc View Source

SetHealthAsync(Double)

Declaration
public Task SetHealthAsync(double health)
Parameters
Type Name Description
System.Double health
Returns
Type Description
Task
| Improve this Doc View Source

SetHungerAsync(Double)

Declaration
public Task SetHungerAsync(double hunger)
Parameters
Type Name Description
System.Double hunger
Returns
Type Description
Task
| Improve this Doc View Source

SetPositionAsync(System.Numerics.Vector3)

Declaration
public Task<bool> SetPositionAsync(System.Numerics.Vector3 position)
Parameters
Type Name Description
System.Numerics.Vector3 position
Returns
Type Description
Task<System.Boolean>
| Improve this Doc View Source

SetPositionAsync(System.Numerics.Vector3, Quaternion)

Declaration
public Task<bool> SetPositionAsync(System.Numerics.Vector3 position, Quaternion rotation)
Parameters
Type Name Description
System.Numerics.Vector3 position
Quaternion rotation
Returns
Type Description
Task<System.Boolean>
| Improve this Doc View Source

SetThirstAsync(Double)

Declaration
public Task SetThirstAsync(double thirst)
Parameters
Type Name Description
System.Double thirst
Returns
Type Description
Task

Explicit Interface Implementations

| Improve this Doc View Source

IHasInventory.Inventory

Declaration
IInventory IHasInventory.Inventory { get; }
Returns
Type Description
IInventory
| Improve this Doc View Source

ICanEnterVehicle.CurrentVehicle

Declaration
IVehicle ICanEnterVehicle.CurrentVehicle { get; }
Returns
Type Description
IVehicle

Implements

IPlayer
IEntity
IGameObject
IHasHealth
IHasInventory
ICanEnterVehicle
IDamageSource
IHasHunger
IHasThirst

Extension Methods

DisposeHelper.DisposeSyncOrAsync(Object)