Class endstone::Effect¶
Represents an effect that can be added to a Mob .More...
#include <endstone/potion/effect.h>
Public Functions¶
| Type | Name |
|---|---|
| constexpr | Effect (EffectId type, std::optional< int > duration, int amplifier, bool ambient=false, bool particles=true, bool icon=true) Creates an effect. |
| constexpr int | getAmplifier () noexcept const Gets the amplifier of this effect. |
| constexpr std::optional< int > | getDuration () noexcept const Gets the duration of this effect, in ticks. |
| constexpr EffectId | getType () noexcept const Gets the type of this effect. |
| constexpr bool | hasIcon () noexcept const Gets whether this effect has an icon. |
| constexpr bool | hasParticles () noexcept const Gets whether this effect has particles. |
| constexpr bool | isAmbient () noexcept const Makes the effect produce more, translucent, particles. |
| constexpr bool | isInfinite () noexcept const Returns whether this effect has an infinite duration. |
| constexpr bool | operator!= (const Effect & other) noexcept const |
| constexpr bool | operator== (const Effect & other) noexcept const |
Detailed Description¶
An effect is an immutable description of an effect type together with a duration, amplifier and a set of display options. Applying it to a Mob (e.g. via Mob::addEffect) installs the effect; querying a Mob's active effects yields Effect values describing what is currently in force.
Public Functions Documentation¶
function Effect¶
Creates an effect.
inline constexpr endstone::Effect::Effect (
EffectId type,
std::optional< int > duration,
int amplifier,
bool ambient=false,
bool particles=true,
bool icon=true
)
Parameters:
typeeffect typedurationmeasured in ticks, or std::nullopt for an infinite duration, see Effect::getDurationamplifierthe amplifier for the effect, see Effect::getAmplifierambientthe ambient status, see Effect::isAmbientparticlesthe particle status, see Effect::hasParticlesiconthe icon status, see Effect::hasIcon
function getAmplifier¶
Gets the amplifier of this effect.
A higher amplifier means the effect happens more often over its duration and in some cases has more effect on its target.
Returns:
the amplifier
function getDuration¶
Gets the duration of this effect, in ticks.
Returns:
the duration in ticks, or std::nullopt if this effect is infinite
function getType¶
Gets the type of this effect.
Returns:
the type
function hasIcon¶
Gets whether this effect has an icon.
Returns:
whether this effect has an icon
function hasParticles¶
Gets whether this effect has particles.
Returns:
whether this effect has particles
function isAmbient¶
Makes the effect produce more, translucent, particles.
Returns:
whether this effect is ambient
function isInfinite¶
Returns whether this effect has an infinite duration.
Effects with an infinite duration never expire unless manually removed.
Returns:
whether this effect is infinite
function operator!=¶
function operator==¶
The documentation for this class was generated from the following file include/endstone/potion/effect.h