use of net.minecraft.server.v1_12_R1.NBTTagDouble in project custom-items-gradle by knokko.
the class ItemAttributes method setAttribute.
private static void setAttribute(NBTTagList modifiers, String name, double value, String slot, int operation) {
NBTTagCompound damage = new NBTTagCompound();
damage.set("AttributeName", new NBTTagString(name));
damage.set("Name", new NBTTagString(name));
damage.set("Amount", new NBTTagDouble(value));
damage.set("Operation", new NBTTagInt(operation));
long most = modifiers.size() + 1 + slot.hashCode() * name.hashCode();
long least = modifiers.size() + 1 + slot.hashCode() + name.hashCode();
if (most == 0)
most = -8;
if (least == 0)
least = 12;
damage.set("UUIDLeast", new NBTTagLong(least));
damage.set("UUIDMost", new NBTTagLong(most));
damage.set("Slot", new NBTTagString(slot));
modifiers.add(damage);
}
Aggregations