Files
MinecraftConsoles/Minecraft.World/MobEffectInstance.h

56 lines
1.1 KiB
C
Raw Normal View History

2026-03-01 12:16:08 +08:00
#pragma once
class Mob;
class MobEffectInstance
{
private:
// sent as byte
int id;
// sent as short
int duration;
// sent as byte
int amplifier;
bool splash;
bool ambient;
bool noCounter;
2026-03-01 12:16:08 +08:00
void _init(int id, int duration, int amplifier);
public:
MobEffectInstance(int id);
MobEffectInstance(int id, int duration);
MobEffectInstance(int id, int duration, int amplifier);
MobEffectInstance(int id, int duration, int amplifier, bool ambient);
2026-03-01 12:16:08 +08:00
MobEffectInstance(MobEffectInstance *copy);
void update(MobEffectInstance *takeOver);
int getId();
int getDuration();
int getAmplifier();
bool isSplash();
void setSplash(bool splash);
bool isAmbient();
bool tick(shared_ptr<LivingEntity> target);
2026-03-01 12:16:08 +08:00
private:
int tickDownDuration();
public:
void applyEffect(shared_ptr<LivingEntity> mob);
2026-03-01 12:16:08 +08:00
int getDescriptionId();
int getPostfixDescriptionId(); // 4J Added
int hashCode();
wstring toString();
// Was bool equals(Object obj)
bool equals(MobEffectInstance *obj);
CompoundTag *save(CompoundTag *tag);
static MobEffectInstance *load(CompoundTag *tag);
void setNoCounter(bool noCounter);
bool isNoCounter();
2026-03-01 12:16:08 +08:00
};