EntityUtils

Functions

Link copied to clipboard
fun createBlockDropItemEntities(pos: BlockPos, items: Iterable<ItemStack>): List<ItemEntity>

Creates not-spawned item entities based on the specified items and pos.

Link copied to clipboard
fun createFakePlayer(location: Location, uuid: UUID = UUID.randomUUID(), name: String = "Nova FakePlayer", hasEvents: Boolean = false): ServerPlayer

Creates a fake ServerPlayer object.

Link copied to clipboard
fun deserializeAndSpawn(data: ByteArray, location: Location, spawnReason: EntitySpawnReason = EntitySpawnReason.MOB_SUMMONED, nbtModifier: (CompoundTag) -> CompoundTag? = null): Entity

Spawns an BukkitEntity based on serialized data and a location.

fun deserializeAndSpawn(data: ByteArray, location: Location, spawnReason: EntitySpawnReason = EntitySpawnReason.MOB_SUMMONED, disallowedEntityTypes: Set<EntityType> = DEFAULT_DESERIALIZATION_DISALLOWED_ENTITY_TYPES, nbtModifier: (CompoundTag) -> CompoundTag? = null): Entity?

Spawns an BukkitEntity based on serialized data and a location, skipping all entities whose EntityType or their passengers are in the disallowedEntityTypes set.

Link copied to clipboard
fun getAllPassengers(entity: Entity): List<Entity>

Gets a list of all passengers of this BukkitEntity, including passengers of passengers.

Link copied to clipboard
fun serialize(entity: Entity, remove: Boolean = false, nbtModifier: (CompoundTag) -> CompoundTag? = null): ByteArray

Serializes an BukkitEntity to a ByteArray.