@Override public void run() { if (target != null && target.isValid()) { target.setCustomNameVisible(oldNameVisible); target.setCustomName(oldName); target.removeMetadata(mcMMO.customNameKey, mcMMO.p); target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p); } } }
@Override public void setName(String name) { this.name = name; if (!isSpawned()) return; Entity bukkitEntity = getEntity(); if (bukkitEntity instanceof LivingEntity) { ((LivingEntity) bukkitEntity).setCustomName(getFullName()); } if (bukkitEntity.getType() == EntityType.PLAYER) { Location old = bukkitEntity.getLocation(); despawn(DespawnReason.PENDING_RESPAWN); spawn(old); } }
public void setVillagerNametag() { Iterator<Entity> entityIterator = this.world.getEntities().iterator(); while (entityIterator.hasNext()) { Entity e = entityIterator.next(); if (!this.isInRegion(e.getLocation())) { continue; } if (e.getType() == EntityType.VILLAGER) { LivingEntity le = (LivingEntity) e; le.setCustomNameVisible(false); le.setCustomName( BedwarsRel ._l(BedwarsRel.getInstance().getServer().getConsoleSender(), "ingame.shop.name")); } } } }
LivingEntity e = (LivingEntity)location.getWorld().spawnEntity(center, EntityType.valueOf(ent.getString("type", "PIG"))); if (e != null) { e.setCustomName(ent.getString("name"));
public void setVillagerNametag() { Iterator<Entity> entityIterator = this.world.getEntities().iterator(); while (entityIterator.hasNext()) { Entity e = entityIterator.next(); if (!this.isInRegion(e.getLocation())) { continue; } if (e.getType() == EntityType.VILLAGER) { LivingEntity le = (LivingEntity) e; le.setCustomNameVisible(false); le.setCustomName( BedwarsRel ._l(BedwarsRel.getInstance().getServer().getConsoleSender(), "ingame.shop.name")); } } } }
entity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", player.getName(), StringUtils.getPrettyEntityTypeString(type)));
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onEntityDeath(EntityDeathEvent event) { Entity entity = event.getEntity(); if (!(entity instanceof LivingEntity)) { return; } LivingEntity died = (LivingEntity)entity; String name = died.getCustomName(); if (name == null || name.isEmpty()) { EntityData mob = defaultMobs.get(died.getType()); if (mob != null && !died.hasMetadata("nodrops")) { mob.modifyDrops(controller, event); } return; } EntityData mob = mobsByName.get(name); if (mob == null) return; MagicMobDeathEvent deathEvent = new MagicMobDeathEvent(controller, mob, event); Bukkit.getPluginManager().callEvent(deathEvent); if (!died.hasMetadata("nodrops")) { mob.modifyDrops(controller, event); } // Prevent double-deaths .. gg Mojang? // Kind of hacky to use this flag for it, but seemed easiest died.setCustomNameVisible(false); died.setCustomName(null); }
entity.setCustomName("Giant Terry"); } else if (entity instanceof Monster) { bitQuest.createBossFight(e.getEntity().getLocation()); entity.setCustomName( String.format( "%s lvl %d", if(entity instanceof Wither) { level=level+10; entity.setCustomName("Wither (Reward: "+Math.round((bitQuest.LAND_PRICE)/bitQuest.DENOMINATION_FACTOR)+" "+bitQuest.DENOMINATION_NAME+")");
/** * Monitor EntityDeath events. * * @param event * The event to watch */ @EventHandler(priority = EventPriority.LOWEST) public void onEntityDeathLowest(EntityDeathEvent event) { /* WORLD BLACKLIST CHECK */ if(WorldBlacklist.isWorldBlacklisted(event.getEntity().getWorld())) return; LivingEntity entity = event.getEntity(); if (Misc.isNPCEntity(entity)) { return; } if (entity.hasMetadata(mcMMO.customNameKey)) { entity.setCustomName(entity.getMetadata(mcMMO.customNameKey).get(0).asString()); entity.removeMetadata(mcMMO.customNameKey, plugin); } if (entity.hasMetadata(mcMMO.customVisibleKey)) { entity.setCustomNameVisible(entity.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean()); entity.removeMetadata(mcMMO.customVisibleKey, plugin); } if (entity.hasMetadata(mcMMO.entityMetadataKey)) { entity.removeMetadata(mcMMO.entityMetadataKey, plugin); } }
entity.setCustomName(entityName);
((BossWave) w).setBossName("SPIGOT ERROR"); } else { e.setCustomName("SPIGOT ERROR"); bw.activateAbilities(arena); if (bw.getBossName() != null) { e.setCustomName(bw.getBossName()); e.setCustomNameVisible(true);
livingEntity.setCustomName(name);
String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage); target.setCustomName(newName); target.setCustomNameVisible(true);
ent.setCustomName(pet.getName());
living.setRemoveWhenFarAway(false); living.setCanPickupItems(false); living.setCustomName(value.getTeam().getChatColor() + value.getTeam().getDisplayName()); living.setCustomNameVisible( BedwarsRel.getInstance().getBooleanConfig("jointeam-entity.show-name", true));
living.setRemoveWhenFarAway(false); living.setCanPickupItems(false); living.setCustomName(value.getTeam().getChatColor() + value.getTeam().getDisplayName()); living.setCustomNameVisible( BedwarsRel.getInstance().getBooleanConfig("jointeam-entity.show-name", true));