Skip to content

API reference Obsidian.API

ILiving interface

public interface ILiving : IEntity, IAttachmentHolder

In Obsidian.API.

Properties

int AbsorbedArrows { get; set; }int AbsorbtionAmount { get; set; }uint ActiveEffectColor { get; }

ActivePotionEffects

IReadOnlyDictionary<int, EffectWithCurrentDuration> ActivePotionEffects { get; }

The dictionary containing all active PotionEffect with their respective PotionEffectData.

bool Alive { get; }bool AmbientPotionEffect { get; set; }Vector? BedBlockPosition { get; set; }LivingBitMask LivingBitMask { get; set; }

Methods

AddPotionEffect(int, int, int, EntityEffectFlags)

void AddPotionEffect(int effectId, int duration, int amplifier = 0, EntityEffectFlags effectFlags = 0);

Adds the given PotionEffect to the entity.

Parameters

effectId
The potion effect to be added.
duration
The duration of the potion in ticks.
amplifier
The amplifier of the effect. The given amplifier + 1 will be displayed in the HUD.
effectFlags
Modifies how the effect should be displayed.

ClearPotionEffects()

void ClearPotionEffects();

Clears all potion effects of the entity.

HasPotionEffect(int)

bool HasPotionEffect(int effectId);

Whether the entity has the given PotionEffect or not.

Parameters

effectId
The potion effect to be checked.

Returns

True, if the entity has the potion effect.

RemovePotionEffect(int)

void RemovePotionEffect(int effectId);

Removes the given PotionEffect from the entity.

Parameters

effectId
The potion effect to be removed.

On this page