Table of Contents

Class PotionEffectData

Namespace
Obsidian.API
Assembly
Obsidian.API.dll

The potion effect data holds additional information about an active PotionEffect.

public sealed record PotionEffectData : INetworkSerializable<PotionEffectData>, IEquatable<PotionEffectData>
Inheritance
PotionEffectData
Implements
Inherited Members

Constructors

PotionEffectData()

public PotionEffectData()

Properties

Ambient

Produces more translucent particle effects if true.

public bool Ambient { get; init; }

Property Value

bool

Amplifier

The amplifier of the potion effect.

public required int Amplifier { get; init; }

Property Value

int

Duration

The duration of the potion effect when it was added.

public required int Duration { get; init; }

Property Value

int

HiddenEffect

Used to store the state of the previous potion effect when a stronger one is applied. This guarantees that the weaker one will persist, in case it lasts longer.

public PotionEffectData? HiddenEffect { get; init; }

Property Value

PotionEffectData

Id

public required int Id { get; init; }

Property Value

int

ShowIcon

Shows the potion icon in the inventory screen if true.

public bool ShowIcon { get; init; }

Property Value

bool

ShowParticles

Completely hides effect particles if false.

public bool ShowParticles { get; init; }

Property Value

bool

Methods

Equals(PotionEffectData?)

public bool Equals(PotionEffectData? other)

Parameters

other PotionEffectData

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(PotionEffectData?, PotionEffectData?)

public static bool operator ==(PotionEffectData? left, PotionEffectData? right)

Parameters

left PotionEffectData
right PotionEffectData

Returns

bool

operator !=(PotionEffectData?, PotionEffectData?)

public static bool operator !=(PotionEffectData? left, PotionEffectData? right)

Parameters

left PotionEffectData
right PotionEffectData

Returns

bool

Explicit Interface Implementations

Read(INetStreamReader)

static PotionEffectData Read(INetStreamReader reader)

Parameters

reader INetStreamReader

Returns

PotionEffectData

Write(PotionEffectData, INetStreamWriter)

static void Write(PotionEffectData value, INetStreamWriter writer)

Parameters

value PotionEffectData
writer INetStreamWriter