Advertisement
TNT_Block

HologramText

Oct 2nd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. package de.cryptonicdev.cryptonic.commands.impl.itemstackmodes;
  2.  
  3. import net.minecraft.init.Items;
  4. import net.minecraft.item.ItemStack;
  5. import net.minecraft.nbt.NBTTagCompound;
  6. import net.minecraft.nbt.NBTTagDouble;
  7. import net.minecraft.nbt.NBTTagList;
  8.  
  9. public class HologramText {
  10.  
  11. public static ItemStack generate(String text, double x, double y, double z) {
  12. // /summon ArmorStand ~ ~ ~
  13. // {Invisible:1b,Invulnerable:1b,NoBasePlate:1b,NoGravity:1b,CustomName:"text",CustomNameVisible:1b}
  14.  
  15. ItemStack itm = new ItemStack(Items.armor_stand);
  16.  
  17. NBTTagCompound base = new NBTTagCompound();
  18. base.setByte("HideFlags", (byte) 63);
  19.  
  20. NBTTagCompound entityTag = new NBTTagCompound();
  21. entityTag.setInteger("Invisible", 1);
  22. entityTag.setInteger("Invulnerable", 1);
  23. entityTag.setInteger("NoBasePlate", 1);
  24. entityTag.setInteger("NoGravity", 1);
  25. entityTag.setString("CustomName", text);
  26. entityTag.setInteger("CustomNameVisible", 1);
  27.  
  28. NBTTagList pos = new NBTTagList();
  29. pos.appendTag(new NBTTagDouble(x));
  30. pos.appendTag(new NBTTagDouble(y));
  31. pos.appendTag(new NBTTagDouble(z));
  32.  
  33. entityTag.setTag("Pos", pos);
  34. base.setTag("EntityTag", entityTag);
  35. itm.setTagCompound(base);
  36.  
  37. return itm;
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement