Interface Nameable
- All Known Subinterfaces:
AbstractArrow, AbstractCow, AbstractHorse, AbstractNautilus, AbstractSkeleton, AbstractVillager, AbstractWindCharge, AcaciaBoat, AcaciaChestBoat, Ageable, Allay, Ambient, Animals, AreaEffectCloud, Armadillo, ArmorStand, Arrow, Axolotl, BambooChestRaft, BambooRaft, Barrel, Bat, Beacon, Bee, BirchBoat, BirchChestBoat, BlastFurnace, Blaze, BlockDisplay, Boat, Bogged, Boss, Breedable, Breeze, BreezeWindCharge, BrewingStand, Camel, CamelHusk, Cat, CaveSpider, CherryBoat, CherryChestBoat, Chest, ChestBoat, ChestedHorse, Chicken, Cod, CommandMinecart, ComplexEntityPart, ComplexLivingEntity, Container, CopperGolem, Cow, Crafter, Creaking, Creature, Creeper, Damageable, DarkOakBoat, DarkOakChestBoat, Dispenser, Display, Dolphin, Donkey, DragonFireball, Dropper, Drowned, Egg, ElderGuardian, EnchantingTable, EnderCrystal, EnderDragon, EnderDragonPart, Enderman, Endermite, EnderPearl, EnderSignal, Enemy, Entity, Evoker, EvokerFangs, ExperienceOrb, Explosive, ExplosiveMinecart, FallingBlock, Fireball, Firework, Fish, FishHook, Flying, Fox, Frog, Furnace, Ghast, Giant, GlowItemFrame, GlowSquid, Goat, Golem, Guardian, Hanging, HappyGhast, Hoglin, Hopper, HopperMinecart, Horse, HumanEntity, Husk, Illager, Illusioner, Interaction, IronGolem, Item, ItemDisplay, ItemFrame, JungleBoat, JungleChestBoat, LargeFireball, LeashHitch, LightningStrike, LingeringPotion, LivingEntity, Llama, LlamaSpit, MagmaCube, MangroveBoat, MangroveChestBoat, Mannequin, Marker, Minecart, Mob, Monster, Mule, MushroomCow, Nautilus, NPC, OakBoat, OakChestBoat, Ocelot, OminousItemSpawner, Painting, PaleOakBoat, PaleOakChestBoat, Panda, Parched, Parrot, Phantom, Pig, Piglin, PiglinAbstract, PiglinBrute, PigZombie, Pillager, Player, PolarBear, PoweredMinecart, Projectile, PufferFish, Rabbit, Raider, Ravager, RideableMinecart, Salmon, Sheep, Shulker, ShulkerBox, ShulkerBullet, Silverfish, SizedFireball, Skeleton, SkeletonHorse, Slime, SmallFireball, Smoker, Sniffer, Snowball, Snowman, SpawnerMinecart, SpectralArrow, Spellcaster, Spider, SplashPotion, SpruceBoat, SpruceChestBoat, Squid, Steerable, StorageMinecart, Stray, Strider, Tadpole, Tameable, TextDisplay, ThrowableProjectile, ThrownExpBottle, ThrownPotion, TippedArrow, TNTPrimed, TraderLlama, Trident, TropicalFish, Turtle, Vehicle, Vex, Villager, Vindicator, WanderingTrader, Warden, WaterMob, WindCharge, Witch, Wither, WitherSkeleton, WitherSkull, Wolf, Zoglin, Zombie, ZombieHorse, ZombieNautilus, ZombieVillager
public interface Nameable
Represents a block, entity, or other object that may receive a custom name.
-
Method Summary
Modifier and TypeMethodDescriptionGets the custom name on a mob or block.voidsetCustomName(String name) Sets a custom name on a mob or block.
-
Method Details
-
getCustomName
Gets the custom name on a mob or block. If there is no name this method will return null.This value has no effect on players, they will always use their real name.
- Returns:
- name of the mob/block or null
-
setCustomName
Sets a custom name on a mob or block. This name will be used in death messages and can be sent to the client as a nameplate over the mob.Setting the name to null or an empty string will clear it.
This value has no effect on players, they will always use their real name.
- Parameters:
name- the name to set
-