Package net.minecraft.server.v1_4_R1

Examples of net.minecraft.server.v1_4_R1.NBTTagCompound


    public static LivingEntity addCustomNBT(LivingEntity entity, String key, String value) {
        if (entity == null) return null;
        Entity bukkitEntity = entity;
        net.minecraft.server.v1_7_R4.Entity nmsEntity = ((CraftEntity) bukkitEntity).getHandle();
        NBTTagCompound tag = new NBTTagCompound();

        // Writes the entity's NBT data to tag
        nmsEntity.c(tag);

        // Add custom NBT
        tag.setString(key, value);

        // Write tag back
        ((EntityLiving)nmsEntity).a(tag);
        return entity;
    }
View Full Code Here


    public static LivingEntity removeCustomNBT(LivingEntity entity, String key) {
        if (entity == null) return null;
        Entity bukkitEntity = entity;
        net.minecraft.server.v1_7_R4.Entity nmsEntity = ((CraftEntity) bukkitEntity).getHandle();
        NBTTagCompound tag = new NBTTagCompound();

        // Writes the entity's NBT data to tag
        nmsEntity.c(tag);

        // Remove custom NBT
        tag.remove(key);

        // Write tag back
        ((EntityLiving)nmsEntity).a(tag);
        return entity;
    }
View Full Code Here

TOP

Related Classes of net.minecraft.server.v1_4_R1.NBTTagCompound

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.