Package org.geysermc.geyser.entity.type
Class TextDisplayEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.DisplayBaseEntity
org.geysermc.geyser.entity.type.TextDisplayEntity
- All Implemented Interfaces:
org.geysermc.geyser.api.entity.type.GeyserEntity
-
Field Summary
Fields inherited from class org.geysermc.geyser.entity.type.Entity
bedrockDefinition, customName, customNameVisible, dirtyMetadata, entityId, flags, geyserId, headYaw, javaTypeDefinition, motion, nametag, onGround, passengers, pitch, position, propertyManager, scale, session, silent, uuid, valid, vehicle, yaw -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatCalculates the Y offset needed to match Java Edition's text centering behavior for multi-line text displays.voidDespawns the entityint@Nullable ArmorStandEntityOn Java Edition, armor stands can have a custom name shown additionally to the text in the display.protected voidCalled on entity spawn.booleanvoidmoveAbsoluteRaw(org.cloudburstmc.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported) voidmoveRelativeRaw(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround) voidsetCustomName(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<Optional<net.kyori.adventure.text.Component>, ?> entityMetadata) voidsetCustomNameVisible(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata) protected voidsetInvisible(boolean value) Set a boolean - whether the entity is invisible or visibleprotected voidsetNameEntityData(String nametag) voidsetNametagAlwaysShow(boolean value) voidsetText(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<net.kyori.adventure.text.Component, ?> entityMetadata) voidSends the Bedrock metadata to the clientvoidMethods inherited from class org.geysermc.geyser.entity.type.DisplayBaseEntity
bedrockPosition, getTranslation, setTranslationMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, applyScale, bedrockDefinition, bedrockDefinition, bedrockRotation, definition, doesJumpDismount, getBoundingBoxHeight, getBoundingBoxWidth, getDirtyMetadata, getDisplayName, getEntityId, getFlag, getHeadYaw, getJavaTypeDefinition, getMaxAir, getMotion, getNametag, getOffset, getPassengers, getPitch, getPosition, getPropertyManager, getScale, getSession, getVehicle, getYaw, geyserId, hasLeashesToDrop, interact, interactAt, isAlive, isCustomNameVisible, isOnGround, isShaking, isSilent, isValid, javaId, moveAbsolute, moveAbsolute, moveRelative, offset, passengers, playEntityEvent, playEntityEvent, position, scoreVisibility, setAir, setAirSupply, setBoundingBoxHeight, setBoundingBoxWidth, setClientSideSilent, setDimensionsFromPose, setEntityId, setFlag, setFlags, setFlagsDirty, setFreezing, setGliding, setGravity, setHeadYaw, setJavaTypeDefinition, setMotion, setNametag, setOffset, setOnGround, setPassengers, setPitch, setPose, setPosition, setRiderSeatPosition, setScale, setSilent, setSneaking, setSprinting, setValid, setVehicle, setYaw, spawnEntity, standardDisplayName, teamIdentifier, teleport, testInteraction, update, updateBedrockEntityProperties, updateHeadLookRotation, updateInteractiveTag, updateMountOffset, updateNametag, updateNametag, updatePassengerOffsets, updatePositionAndRotation, updatePropertiesBatched, updateRotation, uuid, uuid, value, vehicleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.geysermc.geyser.api.entity.type.GeyserEntity
updatePropertiesBatched, updateProperty
-
Constructor Details
-
TextDisplayEntity
-
-
Method Details
-
initializeMetadata
protected void initializeMetadata()Description copied from class:EntityCalled on entity spawn. Used to populate the entity metadata and flags with default values.- Overrides:
initializeMetadatain classEntity
-
setInvisible
protected void setInvisible(boolean value) Description copied from class:EntitySet a boolean - whether the entity is invisible or visible- Overrides:
setInvisiblein classEntity- Parameters:
value- true if the entity is invisible
-
setCustomNameVisible
public void setCustomNameVisible(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.type.BooleanEntityMetadata entityMetadata) - Overrides:
setCustomNameVisiblein classEntity
-
setCustomName
public void setCustomName(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<Optional<net.kyori.adventure.text.Component>, ?> entityMetadata) - Overrides:
setCustomNamein classEntity
-
setNametagAlwaysShow
public void setNametagAlwaysShow(boolean value) - Overrides:
setNametagAlwaysShowin classEntity
-
setNameEntityData
- Overrides:
setNameEntityDatain classEntity
-
despawnEntity
public void despawnEntity()Description copied from class:EntityDespawns the entity- Overrides:
despawnEntityin classEntity
-
moveRelativeRaw
public void moveRelativeRaw(double relX, double relY, double relZ, float yaw, float pitch, float headYaw, boolean isOnGround) - Overrides:
moveRelativeRawin classEntity
-
moveAbsoluteRaw
public void moveAbsoluteRaw(org.cloudburstmc.math.vector.Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported) - Overrides:
moveAbsoluteRawin classEntity
-
setText
public void setText(org.geysermc.mcprotocollib.protocol.data.game.entity.metadata.EntityMetadata<net.kyori.adventure.text.Component, ?> entityMetadata) -
updateBedrockMetadata
public void updateBedrockMetadata()Description copied from class:EntitySends the Bedrock metadata to the client- Overrides:
updateBedrockMetadatain classEntity
-
updateNameTag
public void updateNameTag() -
calculateLineOffset
public float calculateLineOffset()Calculates the Y offset needed to match Java Edition's text centering behavior for multi-line text displays. In Java Edition, multi-line text displays are centered vertically.- Returns:
- the Y offset to apply based on the number of lines
-
getSecondEntity
On Java Edition, armor stands can have a custom name shown additionally to the text in the display. They are rendered separately, and can cross each other... -
isInvisible
public boolean isInvisible() -
getLineCount
public int getLineCount()
-