35 struct FactorCalculationData {
39 ::ll::TypedStorage<4, 4, int> mPaddingDuration;
40 ::ll::TypedStorage<4, 4, float> mFactorStart;
41 ::ll::TypedStorage<4, 4, float> mFactorTarget;
42 ::ll::TypedStorage<4, 4, float> mFactorCurrent;
45 ::ll::TypedStorage<4, 4, int> mTicksActive;
46 ::ll::TypedStorage<4, 4, float> mFactorPreviousFrame;
47 ::ll::TypedStorage<1, 1, bool> mHadEffectLastTick;
48 ::ll::TypedStorage<1, 1, bool> mHadApplied;
53 FactorCalculationData(FactorCalculationData
const&);
54 FactorCalculationData();
61 MCAPI ::std::unique_ptr<::CompoundTag> save()
const;
63 MCAPI ~FactorCalculationData();
69 MCAPI static ::MobEffect::FactorCalculationData load(
::CompoundTag const* tag);
79 using AttributeBuffPair = ::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeBuff>>;
81 using AttributeModPair = ::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeModifier>>;
86 ::ll::TypedStorage<4, 4, uint const> mId;
87 ::ll::TypedStorage<1, 1, bool> mIsHarmful;
88 ::ll::TypedStorage<4, 16, ::mce::Color> mColor;
89 ::ll::TypedStorage<8, 48, ::HashedString> mParticleEffectId;
90 ::ll::TypedStorage<8, 48, ::HashedString> mParticleEffectAmbientId;
91 ::ll::TypedStorage<8, 32, ::std::string> mDescriptionId;
92 ::ll::TypedStorage<4, 4, int> mIcon;
93 ::ll::TypedStorage<4, 4, float> mDurationModifier;
94 ::ll::TypedStorage<1, 1, bool> mIsDisabled;
95 ::ll::TypedStorage<8, 32, ::std::string> mResourceName;
96 ::ll::TypedStorage<8, 32, ::std::string> mIconName;
97 ::ll::TypedStorage<1, 1, bool> mEffectVisible;
98 ::ll::TypedStorage<4, 8, ::std::optional<::SharedTypes::Legacy::LevelSoundEvent>> mOnApplySound;
99 ::ll::TypedStorage<8, 48, ::HashedString> mComponentName;
100 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Amplifier>> mValueAmplifier;
101 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Amplifier>> mDurationAmplifier;
102 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeBuff>>>>
104 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeModifier>>>>
106 ::ll::TypedStorage<8, 96, ::MobEffect::FactorCalculationData> mFactorCalculationData;
116 virtual ~MobEffect();
122 virtual void onEffectExpired(
::Actor& target)
const;
124 virtual void onActorDied(
::Actor& target,
int amplifier)
const;
129 applyInstantaneousEffect(
::Actor* source,
::Actor* owner,
::Actor* target,
int amplification,
float scale)
const;
131 virtual bool isInstantaneous()
const;
133 virtual float getAttributeModifierValue(
int amplifier,
::AttributeModifier const& modifier)
const;
141 ::std::string
const& resourceName,
142 ::std::string
const& locName,
146 ::std::string
const& iconName,
150 MCAPI ::InstantaneousAttributeBuff
151 _createInstantBuff(
::AttributeBuff const& baseBuff,
int amplification,
float scale)
const;
153 MCAPI ::TemporalAttributeBuff
156 MCAPI
void _setParticleEffectIds(
char const* particleEffectId,
char const* particleEffectAmbientId);
158 MCAPI
void addAttributeBuff(
::Attribute const& attribute, ::std::shared_ptr<::AttributeBuff> buff);
160 MCAPI
void addAttributeModifier(
::Attribute const& attribute, ::std::shared_ptr<::AttributeModifier> modifier);
162 MCAPI
void applyModsAndBuffs(
169 MCAPI ::std::string
const& getIconName()
const;
172 MCAPI
void setDurationAmplifier(::std::shared_ptr<::Amplifier> amplifier);
176 MCAPI
void setValueAmplifier(::std::shared_ptr<::Amplifier> amplifier);
178 MCAPI
void updateModsAndBuffs(
192 MCAPI static ::MobEffect* getById(uint effectId);
195 MCAPI static ::MobEffect* getByName(::std::string
const& name);
197 MCAPI static ::MobEffect::FactorCalculationData getDarknessEffectFactorCalculationData();
205 MCAPI static ::MobEffect*& ABSORPTION();
207 MCAPI static ::MobEffect*& BAD_OMEN();
209 MCAPI static ::MobEffect*& BLINDNESS();
211 MCAPI static ::MobEffect*& CONDUIT_POWER();
213 MCAPI static ::MobEffect*& CONFUSION();
215 MCAPI static ::MobEffect*& DAMAGE_BOOST();
217 MCAPI static ::MobEffect*& DAMAGE_RESISTANCE();
219 MCAPI static ::MobEffect*& DARKNESS();
221 MCAPI static ::mce::Color
const& DEFAULT_COLOR();
223 MCAPI static ::MobEffect*& DIG_SLOWDOWN();
225 MCAPI static ::MobEffect*& DIG_SPEED();
227 MCAPI static ::MobEffect*& EMPTY_EFFECT();
229 MCAPI static ::MobEffect*& FATAL_POISON();
231 MCAPI static ::MobEffect*& FIRE_RESISTANCE();
233 MCAPI static ::MobEffect*& HARM();
235 MCAPI static ::MobEffect*& HEAL();
237 MCAPI static ::MobEffect*& HEALTH_BOOST();
239 MCAPI static ::MobEffect*& HERO_OF_THE_VILLAGE();
241 MCAPI static ::MobEffect*& HUNGER();
243 MCAPI static ::MobEffect*& INFESTED();
245 MCAPI static ::MobEffect*& INVISIBILITY();
247 MCAPI static ::MobEffect*& JUMP();
249 MCAPI static ::MobEffect*& LEVITATION();
251 MCAPI static ::MobEffect*& MOVEMENT_SLOWDOWN();
253 MCAPI static ::MobEffect*& MOVEMENT_SPEED();
255 MCAPI static ::MobEffect*& NIGHT_VISION();
257 MCAPI static ::MobEffect*& OOZING();
259 MCAPI static ::MobEffect*& POISON();
261 MCAPI static ::MobEffect*& RAID_OMEN();
263 MCAPI static ::MobEffect*& REGENERATION();
265 MCAPI static ::MobEffect*& SATURATION();
267 MCAPI static ::MobEffect*& SLOW_FALLING();
269 MCAPI static ::MobEffect*& TRIAL_OMEN();
271 MCAPI static ::MobEffect*& WATER_BREATHING();
273 MCAPI static ::MobEffect*& WEAKNESS();
275 MCAPI static ::MobEffect*& WEAVING();
277 MCAPI static ::MobEffect*& WIND_CHARGED();
279 MCAPI static ::MobEffect*& WITHER();
281 MCAPI static ::std::add_lvalue_reference_t<::std::unique_ptr<::MobEffect>[]> mMobEffects();
289 ::std::string
const& resourceName,
290 ::std::string
const& locName,
294 ::std::string
const& iconName,
312 MCFOLD
void $onEffectExpired(
::Actor& target)
const;
314 MCFOLD
void $onActorDied(
::Actor& target,
int amplifier)
const;
319 $applyInstantaneousEffect(
::Actor* source,
::Actor* owner,
::Actor* target,
int amplification,
float scale)
const;
321 MCFOLD
bool $isInstantaneous()
const;
323 MCAPI
float $getAttributeModifierValue(
int amplifier,
::AttributeModifier const& modifier)
const;
331 MCAPI
static void** $vftable();