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

Tameable animals don't show custom names after owner is set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version 3085-Spigot-9fb885e-fd905ab (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
    • Yes

      Setting a Tameable entity's owner with setOwner() will make the Entity's custom name tag disappear.

      For example, the following will spawn a Cat with the custom name, and 30 ticks later will set the owner as the player, which for some reason will remove the name tag. The custom name technically exists (entity.getCustomName()), although the name tag is no longer visible (entity.isCustomNameVisible() is true). 

                  Cat entity = (Cat) player.getLocation().getWorld().spawnEntity(player.getLocation(), EntityType.CAT);
      
      
      
                  entity.setCustomName("Some name");
      
                  entity.setCustomNameVisible(true);
      
                 
      
                  Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
      
                      @Override
      
                      public void run() {
      
                          entity.setOwner(player);
      
                      }
      
                  }, 30L);
      

            Unassigned Unassigned
            Snicko Jack
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: