Class EntityUtils
java.lang.Object
com.github.skriptdev.skript.api.hytale.utils.EntityUtils
Quick utility class for accessing entity components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Pair<com.hypixel.hytale.server.core.entity.Entity, com.hypixel.hytale.server.core.modules.entity.item.ItemComponent> dropItem(com.hypixel.hytale.component.Store<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> store, com.hypixel.hytale.server.core.inventory.ItemStack itemStack, com.hypixel.hytale.math.vector.Location location, com.hypixel.hytale.math.vector.Vector3f velocity, float pickupDelay) static <ECS_TYPE, T extends com.hypixel.hytale.component.Component<ECS_TYPE>>
TgetComponent(com.hypixel.hytale.server.core.entity.Entity entity, com.hypixel.hytale.component.ComponentType<ECS_TYPE, T> type) Get a component from an Entitystatic @Nullable com.hypixel.hytale.server.core.modules.entitystats.EntityStatMapgetEntityStatMap(com.hypixel.hytale.server.core.entity.LivingEntity entity) Get the EntityStatMap component of an entity.static @Nullable com.hypixel.hytale.server.core.entity.movement.MovementStatesComponentgetMovementStatesComponent(com.hypixel.hytale.server.core.entity.Entity entity) Get the MovementStatesComponent of an entity.getName(com.hypixel.hytale.server.core.entity.Entity entity) Get the name of anEntity.Get the UUID of anEntitygetVariableName(com.hypixel.hytale.server.core.entity.Entity entity) static voidsetNameplateName(com.hypixel.hytale.server.core.entity.Entity entity, @Nullable String name) Set the name of anEntity.
-
Constructor Details
-
EntityUtils
public EntityUtils()
-
-
Method Details
-
getUUID
-
getName
-
getVariableName
-
setNameplateName
-
getComponent
@Nullable public static <ECS_TYPE, T extends com.hypixel.hytale.component.Component<ECS_TYPE>> T getComponent(com.hypixel.hytale.server.core.entity.Entity entity, com.hypixel.hytale.component.ComponentType<ECS_TYPE, T> type) Get a component from an Entity- Type Parameters:
ECS_TYPE- EntityStore TypeT- Type of returned component- Parameters:
entity- Entity to get component fromtype- Component type to get- Returns:
- Component from entity if available otherwise null
-
getEntityStatMap
@Nullable public static @Nullable com.hypixel.hytale.server.core.modules.entitystats.EntityStatMap getEntityStatMap(com.hypixel.hytale.server.core.entity.LivingEntity entity) Get the EntityStatMap component of an entity.- Parameters:
entity- Entity to get component from- Returns:
- EntityStatMap component of the entity, or null if not found
-
getMovementStatesComponent
@Nullable public static @Nullable com.hypixel.hytale.server.core.entity.movement.MovementStatesComponent getMovementStatesComponent(com.hypixel.hytale.server.core.entity.Entity entity) Get the MovementStatesComponent of an entity.- Parameters:
entity- Entity to get component from- Returns:
- MovementStatesComponent of the entity, or null if not found
-
dropItem
@NotNull public static @NotNull Pair<com.hypixel.hytale.server.core.entity.Entity, com.hypixel.hytale.server.core.modules.entity.item.ItemComponent> dropItem(com.hypixel.hytale.component.Store<com.hypixel.hytale.server.core.universe.world.storage.EntityStore> store, com.hypixel.hytale.server.core.inventory.ItemStack itemStack, com.hypixel.hytale.math.vector.Location location, com.hypixel.hytale.math.vector.Vector3f velocity, float pickupDelay)
-