Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
814 B
5
Indexable
var lamaFound = false
val entities = location.chunk.entities
val title = messageManager.getMessage("title")
for (entity in entities) {
    if (entity is Llama && entity.customName() == title) {
        llama = entity
        lamaFound = true
        break
    }
}
if (!lamaFound) {
    llama = world.spawn(Location(world, 0.0, -66.0, 0.0), Llama::class.java) {
        it.setAI(false)
        it.isTamed = true
        it.isInvulnerable = true
        it.isInvisible = true
        it.customName(
            title
        )
        it.isCustomNameVisible = true
        it.isPersistent = true
        it.removeWhenFarAway = false
        it.isSilent = true
        it.strength = 5
        it.isCarryingChest = true
        it.setGravity(false)
    }
}

val inventory = llama.inventory
Leave a Comment