Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.cryptonicdev.cryptonic.commands.impl.itemstackmodes;
- import net.minecraft.init.Items;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagDouble;
- import net.minecraft.nbt.NBTTagList;
- public class HologramText {
- public static ItemStack generate(String text, double x, double y, double z) {
- // /summon ArmorStand ~ ~ ~
- // {Invisible:1b,Invulnerable:1b,NoBasePlate:1b,NoGravity:1b,CustomName:"text",CustomNameVisible:1b}
- ItemStack itm = new ItemStack(Items.armor_stand);
- NBTTagCompound base = new NBTTagCompound();
- base.setByte("HideFlags", (byte) 63);
- NBTTagCompound entityTag = new NBTTagCompound();
- entityTag.setInteger("Invisible", 1);
- entityTag.setInteger("Invulnerable", 1);
- entityTag.setInteger("NoBasePlate", 1);
- entityTag.setInteger("NoGravity", 1);
- entityTag.setString("CustomName", text);
- entityTag.setInteger("CustomNameVisible", 1);
- NBTTagList pos = new NBTTagList();
- pos.appendTag(new NBTTagDouble(x));
- pos.appendTag(new NBTTagDouble(y));
- pos.appendTag(new NBTTagDouble(z));
- entityTag.setTag("Pos", pos);
- base.setTag("EntityTag", entityTag);
- itm.setTagCompound(base);
- return itm;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement