Class MobEntity
java.lang.Object
org.geysermc.geyser.entity.type.Entity
org.geysermc.geyser.entity.type.LivingEntity
org.geysermc.geyser.entity.type.living.MobEntity
- Direct Known Subclasses:
AllayEntity,AmbientEntity,CreatureEntity,EnderDragonEntity,FlyingEntity,SlimeEntity
-
Field Summary
Fields inherited from class org.geysermc.geyser.entity.type.LivingEntity
boots, chestplate, hand, health, helmet, leggings, maxHealth, offHand -
Constructor Summary
ConstructorsConstructorDescriptionMobEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected voidCalled on entity spawn.interact(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand)Simulates interacting with an entity.protected booleanisEnemy()Returns if the entity is hostile.protected booleanprotected InteractionResultmobInteract(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand, GeyserItemStack itemInHand)voidsetLeashHolderBedrockId(long bedrockId)voidsetMobFlags(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata)protected InteractiveTagtestInteraction(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand)Test interacting with the given hand to see if we should send a tag to the Bedrock client.protected InteractiveTagtestMobInteraction(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand, GeyserItemStack itemInHand)Methods inherited from class org.geysermc.geyser.entity.type.LivingEntity
calculateAttribute, checkInteractWithNameTag, createHealthAttribute, hasShield, isAlive, isShaking, setBedPosition, setDimensions, setFreezing, setHealth, setLivingEntityFlags, updateArmor, updateAttribute, updateBedrockAttributes, updateMainHand, updateOffHandMethods inherited from class org.geysermc.geyser.entity.type.Entity
addAdditionalSpawnData, as, despawnEntity, getBedrockRotation, getFlag, getMaxAir, interactAt, moveAbsolute, moveAbsolute, moveRelative, moveRelative, playEntityEvent, playEntityEvent, setAir, setAirSupply, setBoundingBoxHeight, setBoundingBoxWidth, setClientSideSilent, setDisplayName, setDisplayNameVisible, setFlag, setFlags, setGravity, setInvisible, setPose, setRiderSeatPosition, setSilent, spawnEntity, teleport, updateBedrockMetadata, updateHeadLookRotation, updateInteractiveTag, updateMountOffset, updatePassengerOffsets, updatePositionAndRotation, updateRotation
-
Constructor Details
-
MobEntity
public MobEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, com.nukkitx.math.vector.Vector3f position, com.nukkitx.math.vector.Vector3f motion, float yaw, float pitch, float headYaw)
-
-
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 classLivingEntity
-
setMobFlags
public void setMobFlags(com.github.steveice10.mc.protocol.data.game.entity.metadata.type.ByteEntityMetadata entityMetadata) -
setLeashHolderBedrockId
public void setLeashHolderBedrockId(long bedrockId) -
testInteraction
protected final InteractiveTag testInteraction(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand)Description copied from class:EntityTest interacting with the given hand to see if we should send a tag to the Bedrock client. Should usually mirrorEntity.interact(Hand)without any side effects.- Overrides:
testInteractionin classEntity
-
interact
public final InteractionResult interact(com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand)Description copied from class:EntitySimulates interacting with an entity. The code here should mirror Java Edition code to the best of its ability, to ensure packet parity as well as functionality parity (such as sound effect responses).- Overrides:
interactin classLivingEntity
-
testMobInteraction
@Nonnull protected InteractiveTag testMobInteraction(@Nonnull com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand, @Nonnull GeyserItemStack itemInHand) -
mobInteract
@Nonnull protected InteractionResult mobInteract(@Nonnull com.github.steveice10.mc.protocol.data.game.entity.player.Hand hand, @Nonnull GeyserItemStack itemInHand) -
canBeLeashed
protected boolean canBeLeashed() -
isNotLeashed
protected final boolean isNotLeashed() -
isEnemy
protected boolean isEnemy()Returns if the entity is hostile. Used to determine if it can be leashed.
-