Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-1887

MonsterEgg not render type if set into inventory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Major Major
    • None
    • None
    • It is not necessary, windows and linux system tested.

    • Own compiled private plugin.

      Example code:

      	@SuppressWarnings("deprecation")
      	public static ItemStack addNBTSpawnEgg(ItemStack item, int data) {
              net.minecraft.server.v1_9_R1.ItemStack stack = CraftItemStack.asNMSCopy(item);
              NBTTagCompound tagCompound = stack.getTag();
              if(tagCompound == null){
                  tagCompound = new NBTTagCompound();
              }
              NBTTagCompound id = new NBTTagCompound();
              id.setString("id", EntityType.fromId(data).getName());
              tagCompound.set("EntityTag", id);
              stack.setTag(tagCompound);
              Debug.debug(stack.getTag().getCompound("EntityTag").getString("id"));
              return CraftItemStack.asBukkitCopy(stack);
      	}
      

      That works only if i use method player.getInventory().addItem(item); But if i set this item into inventory then not render egg type, is white default monsteregg like without tag. It can be client side bug ? Debug output is OK. "Villager" etc...

            Unassigned Unassigned
            xSkill_Cycanx Martin Klein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: