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

Interface IHasHealth

Represents an object that has health.

Namespace: OpenMod.Extensions.Games.Abstractions.Entities
Assembly: OpenMod.Extensions.Games.Abstractions.dll
Syntax
public interface IHasHealth

Properties

| Improve this Doc View Source

Health

Gets the health of the entity.

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

IsAlive

Checks if the entity is alive.

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

MaxHealth

Gets the max health the entity can have.

Declaration
double MaxHealth { get; }
Property Value
Type Description
System.Double

Methods

| Improve this Doc View Source

DamageAsync(Double)

Damages the entity. Depending on game support, it will trigger damage effects.

Declaration
Task DamageAsync(double amount)
Parameters
Type Name Description
System.Double amount

The amount to damage.

Returns
Type Description
Task
| Improve this Doc View Source

KillAsync()

Kills the entity. Depending on game support, it will trigger death effects.

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

SetFullHealthAsync()

This should set the life/health stats to max (this should include food, water, etc if supported)

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

SetHealthAsync(Double)

Sets the health of the entity. Depending on game support, it will not trigger damage effects.

Declaration
Task SetHealthAsync(double health)
Parameters
Type Name Description
System.Double health

The health to set to.

Returns
Type Description
Task

Extension Methods

DisposeHelper.DisposeSyncOrAsync(Object)