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 SourceHealth
Gets the health of the entity.
Declaration
double Health { get; }
Property Value
Type | Description |
---|---|
System.Double |
IsAlive
Checks if the entity is alive.
Declaration
bool IsAlive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxHealth
Gets the max health the entity can have.
Declaration
double MaxHealth { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceDamageAsync(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 |
KillAsync()
Kills the entity. Depending on game support, it will trigger death effects.
Declaration
Task KillAsync()
Returns
Type | Description |
---|---|
Task |
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 |
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 |