Package eu.mhsl.minenet.minigames.shared.entity

# Class InteractableEntity

java.lang.Object
net.minestom.server.entity.Entity
net.minestom.server.entity.LivingEntity
net.minestom.server.entity.EntityCreature
eu.mhsl.minenet.minigames.shared.entity.InteractableEntity

All Implemented Interfaces:
  `net.kyori.adventure.sound.Sound.Emitter`, `net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>`, `net.minestom.server.entity.ai.EntityAI`, `net.minestom.server.entity.pathfinding.NavigableEntity`, `net.minestom.server.event.EventHandler<net.minestom.server.event.trait.EntityEvent>`, `net.minestom.server.inventory.EquipmentHandler`, `net.minestom.server.permission.PermissionHandler`, `net.minestom.server.snapshot.Snapshotable`, `net.minestom.server.tag.Taggable`, `net.minestom.server.tag.TagReadable`, `net.minestom.server.tag.TagWritable`, `net.minestom.server.Tickable`, `net.minestom.server.timer.Schedulable`, `net.minestom.server.Viewable`

Direct Known Subclasses:
  `GameSelector`, `RoomSelector`

public class InteractableEntity extends net.minestom.server.entity.EntityCreature

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class net.minestom.server.entity.Entity

  `net.minestom.server.entity.Entity.Pose`

- ## Field Summary

  ### Fields inherited from class net.minestom.server.entity.LivingEntity

  `canPickupItem, expandedBoundingBox, invulnerable, isDead, itemPickupCooldown, lastDamageSource`

  ### Fields inherited from class net.minestom.server.entity.Entity

  `currentChunk, entityMeta, entityType, gravityAcceleration, gravityDragPerTick, gravityTickCount, hasPhysics, instance, lastSyncedPosition, metadata, onGround, position, previousPosition, trackingUpdate, uuid, vehicle, velocity, viewEngine, viewers`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InteractableEntity(@NotNull net.minestom.server.entity.EntityType entityType)`
  Declares an Entity with direct callbacks on interaction

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `onAttack(@NotNull net.minestom.server.event.entity.EntityAttackEvent entityAttackEvent)`
  Called when a Player attacks the entity
  `protected void`
  `onDespawn(@NotNull net.minestom.server.event.instance.RemoveEntityFromInstanceEvent removeEntityFromInstanceEvent)`
  Called when instance of entity is unset
  `protected void`
  `onInteract(@NotNull net.minestom.server.event.player.PlayerEntityInteractEvent playerEntityInteractEvent)`
  Called when a Player interacts with the entity
  `protected void`
  `onSpawn(@NotNull net.minestom.server.event.instance.AddEntityToInstanceEvent addEntityToInstanceEvent)`
  Called when instance of entity is set

  ### Methods inherited from class net.minestom.server.entity.EntityCreature

  `attack, attack, getAIGroups, getNavigator, getRemovalAnimationDelay, getTarget, kill, setInstance, setRemovalAnimationDelay, setTarget, update`

  ### Methods inherited from class net.minestom.server.entity.LivingEntity

  `canPickupItem, damage, getArrowCount, getAttribute, getAttributeValue, getBoots, getChestplate, getFireDamagePeriod, getHealth, getHelmet, getItemInMainHand, getItemInOffHand, getLastDamageSource, getLeggings, getLivingEntityMeta, getMaxHealth, getPropertiesPacket, getTargetBlockPosition, getTeam, handleVoid, heal, isDead, isFlyingWithElytra, isImmune, isInvulnerable, onAttributeChanged, refreshActiveHand, refreshIsDead, setArrowCount, setBoots, setBoundingBox, setCanPickupItem, setChestplate, setFireDamagePeriod, setFireDamagePeriod, setFireForDuration, setFireForDuration, setFireForDuration, setFlyingWithElytra, setHealth, setHelmet, setInvulnerable, setItemInMainHand, setItemInOffHand, setLeggings, setTeam, swingMainHand, swingOffHand, takeKnockback, updateNewViewer`

  ### Methods inherited from class net.minestom.server.entity.Entity

  `addEffect, addPassenger, addViewer, asHoverEvent, askSynchronization, autoViewEntities, clearEffects, eventNode, generateId, getAcquirable, getActiveEffects, getAliveTicks, getAllPermissions, getBoundingBox, getChunk, getCustomName, getDistance, getDistance, getDistanceSquared, getEntity, getEntity, getEntityId, getEntityMeta, getEntityType, getEyeHeight, getGravityAcceleration, getGravityDragPerTick, getGravityTickCount, getInstance, getLineOfSight, getLineOfSightEntity, getMetadataPacket, getPassengers, getPassengersPacket, getPose, getPosition, getUuid, getVehicle, getVelocity, getVelocityForPacket, getVelocityPacket, getViewers, hasLineOfSight, hasLineOfSight, hasNoGravity, hasPassenger, hasPredictableViewers, hasVelocity, isActive, isAutoViewable, isCustomNameVisible, isGlowing, isInvisible, isOnFire, isOnGround, isRemoved, isSilent, isSneaking, isSprinting, lookAt, lookAt, refreshCurrentChunk, refreshPosition, refreshPosition, remove, removeEffect, removePassenger, removeViewer, scheduleNextTick, scheduler, scheduleRemove, scheduleRemove, setAutoViewable, setAutoViewEntities, setBoundingBox, setCustomName, setCustomNameVisible, setCustomSynchronizationCooldown, setGlowing, setGravity, setInstance, setInstance, setInvisible, setNoGravity, setOnFire, setPose, setSilent, setSneaking, setSprinting, setUuid, setVelocity, setView, spawn, switchEntityType, synchronizePosition, tagHandler, teleport, teleport, tick, triggerStatus, updateOldViewer, updatePose, updateSnapshot, updateVelocity, updateViewableRule, updateViewableRule, updateViewerRule, updateViewerRule`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface net.minestom.server.entity.ai.EntityAI

  `addAIGroup, addAIGroup, aiTick`

  ### Methods inherited from interface net.minestom.server.inventory.EquipmentHandler

  `getEquipment, getEquipmentsPacket, getItemInHand, hasEquipment, setEquipment, setItemInHand, syncEquipment`

  ### Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource

  `asHoverEvent`

  ### Methods inherited from interface net.minestom.server.permission.PermissionHandler

  `addPermission, getPermission, hasPermission, hasPermission, hasPermission, removePermission, removePermission`

  ### Methods inherited from interface net.minestom.server.tag.Taggable

  `getTag, hasTag, removeTag, setTag`

  ### Methods inherited from interface net.minestom.server.Viewable

  `getViewersAsAudience, getViewersAsAudiences, isViewer, sendPacketsToViewers, sendPacketsToViewers, sendPacketToViewers, sendPacketToViewersAndSelf`

- ## Constructor Details

  - ### InteractableEntity

    public InteractableEntity(@NotNull @NotNull net.minestom.server.entity.EntityType entityType)
    Declares an Entity with direct callbacks on interaction
    Parameters:
      `entityType` - type of entity

- ## Method Details

  - ### onSpawn

    protected void onSpawn(@NotNull @NotNull net.minestom.server.event.instance.AddEntityToInstanceEvent addEntityToInstanceEvent)
    Called when instance of entity is set
    Parameters:
      `addEntityToInstanceEvent` -

  - ### onDespawn

    protected void onDespawn(@NotNull @NotNull net.minestom.server.event.instance.RemoveEntityFromInstanceEvent removeEntityFromInstanceEvent)
    Called when instance of entity is unset
    Parameters:
      `removeEntityFromInstanceEvent` -

  - ### onInteract

    protected void onInteract(@NotNull @NotNull net.minestom.server.event.player.PlayerEntityInteractEvent playerEntityInteractEvent)
    Called when a Player interacts with the entity
    Parameters:
      `playerEntityInteractEvent` -

  - ### onAttack

    protected void onAttack(@NotNull @NotNull net.minestom.server.event.entity.EntityAttackEvent entityAttackEvent)
    Called when a Player attacks the entity
    Parameters:
      `entityAttackEvent` -