Class EntityMeta
java.lang.Object
net.minestom.server.entity.metadata.EntityMeta
- Direct Known Subclasses:
AbstractArrowMeta, AbstractDisplayMeta, AbstractVehicleMeta, AbstractWindChargeMeta, AreaEffectCloudMeta, DragonFireballMeta, EndCrystalMeta, EvokerFangsMeta, ExperienceOrbMeta, EyeOfEnderMeta, FallingBlockMeta, FireballMeta, FireworkRocketMeta, FishingHookMeta, HangingMeta, InteractionMeta, ItemEntityMeta, LeashKnotMeta, LightningBoltMeta, LingeringPotionMeta, LivingEntityMeta, LlamaSpitMeta, MarkerMeta, OminousItemSpawnerMeta, PrimedTntMeta, ShulkerBulletMeta, SmallFireballMeta, SnowballMeta, SplashPotionMeta, ThrownEggMeta, ThrownEnderPearlMeta, ThrownExperienceBottleMeta, TraderLlamaMeta, WitherSkullMeta
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconsumeEntity(Consumer<Entity> consumer) protected <T> Tget(DataComponent<T> component) intstatic <T> TgetComponent(EntityMeta meta, DataComponent<T> component) Exists to hide the component set implementation on meta to direct people to use the method on Entity.Deprecated.getPose()intbooleanbooleanbooleanbooleanbooleanbooleanisOnFire()booleanisSilent()booleanbooleanbooleanprotected <T> voidset(DataComponent<T> component, T value) voidsetAirTicks(int value) static <T> voidsetComponent(EntityMeta meta, DataComponent<T> component, T value) Exists to hide the component set implementation on meta to direct people to use the method on Entity.voidsetCustomName(@Nullable Component value) Deprecated.useDataComponents.CUSTOM_NAMEinstead.voidsetCustomNameVisible(boolean value) voidsetFlyingWithElytra(boolean value) voidsetHasGlowingEffect(boolean value) voidsetHasNoGravity(boolean value) voidsetInvisible(boolean value) voidsetNotifyAboutChanges(boolean notifyAboutChanges) Sets whether any changes to this meta must result in a metadata packet being sent to entity viewers.voidsetOnFire(boolean value) voidsetPose(EntityPose value) voidsetSilent(boolean value) voidsetSneaking(boolean value) voidsetSprinting(boolean value) voidsetSwimming(boolean value) voidsetTickFrozen(int tickFrozen)
-
Field Details
-
metadata
-
-
Constructor Details
-
EntityMeta
-
-
Method Details
-
setNotifyAboutChanges
public void setNotifyAboutChanges(boolean notifyAboutChanges) Sets whether any changes to this meta must result in a metadata packet being sent to entity viewers. By default it's set to true.It's usable if you want to change multiple values of this meta at the same time and want just a single packet being sent: if so, disable notification before your first change and enable it right after the last one: once notification is set to false, we collect all the updates that are being performed, and when it's returned to true we send them all together. An example usage could be found at
LivingEntity.refreshActiveHand(boolean, boolean, boolean).- Parameters:
notifyAboutChanges- if to notify entity viewers about this meta changes.
-
isOnFire
public boolean isOnFire() -
setOnFire
public void setOnFire(boolean value) -
isSneaking
public boolean isSneaking() -
setSneaking
public void setSneaking(boolean value) -
isSprinting
public boolean isSprinting() -
setSprinting
public void setSprinting(boolean value) -
isSwimming
public boolean isSwimming() -
setSwimming
public void setSwimming(boolean value) -
isInvisible
public boolean isInvisible() -
setInvisible
public void setInvisible(boolean value) -
isHasGlowingEffect
public boolean isHasGlowingEffect() -
setHasGlowingEffect
public void setHasGlowingEffect(boolean value) -
isFlyingWithElytra
public boolean isFlyingWithElytra() -
setFlyingWithElytra
public void setFlyingWithElytra(boolean value) -
getAirTicks
public int getAirTicks() -
setAirTicks
public void setAirTicks(int value) -
getCustomName
Deprecated.useDataComponents.CUSTOM_NAMEinstead. -
setCustomName
Deprecated.useDataComponents.CUSTOM_NAMEinstead. -
isCustomNameVisible
public boolean isCustomNameVisible() -
setCustomNameVisible
public void setCustomNameVisible(boolean value) -
isSilent
public boolean isSilent() -
setSilent
public void setSilent(boolean value) -
isHasNoGravity
public boolean isHasNoGravity() -
setHasNoGravity
public void setHasNoGravity(boolean value) -
getPose
-
setPose
-
getTickFrozen
public int getTickFrozen() -
setTickFrozen
public void setTickFrozen(int tickFrozen) -
consumeEntity
-
getComponent
Exists to hide the component set implementation on meta to direct people to use the method on Entity.Planned to only exist while we have both metadata and components separately/all metadata is not represented by components.
- See Also:
-
setComponent
Exists to hide the component set implementation on meta to direct people to use the method on Entity.Planned to only exist while we have both metadata and components separately/all metadata is not represented by components.
- See Also:
-
get
-
set
-
DataComponents.CUSTOM_NAMEinstead.