TitanChase

Untitled

Mar 10th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1.     public static void setPresistedData(EntityPlayer player, String key, String value)
  2.     {
  3.         NBTTagCompound presistedData = player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG);
  4.         if (presistedData == null)
  5.             presistedData = new NBTTagCompound();
  6.         presistedData.setString(key, value);
  7.         player.getEntityData().setTag(player.PERSISTED_NBT_TAG, presistedData);
  8.     }
  9.  
  10.     public static String getPresistedData(EntityPlayer player, String key)
  11.     {
  12.         return player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).getString(key);
  13.     }
  14.  
  15.     public static boolean hasPresistedData(EntityPlayer player, String key)
  16.     {
  17.         return player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).hasKey(key);
  18.     }
Add Comment
Please, Sign In to add comment