All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.entity.EntityAgeable Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.entity;

import cn.nukkit.api.PowerNukkitXOnly;
import cn.nukkit.api.Since;

/**
 * @author MagicDroidX (Nukkit Project)
 */
public interface EntityAgeable {
    default boolean isBaby() {
        return ((Entity) this).getDataFlag(Entity.DATA_FLAGS, Entity.DATA_FLAG_BABY);
    }

    @PowerNukkitXOnly
    @Since("1.19.50-r3")
    default void setBaby(boolean flag) {
        var entity = (Entity) this;
        entity.setDataFlag(Entity.DATA_FLAGS, Entity.DATA_FLAG_BABY, flag);
        entity.setScale(flag ? 0.5f : 1f);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy