Name Conversion Tutorial
There are a few name conversion tools available with MCCore
Mobs
The mobs name conversion goes through the class "MobManager" and has the following methods:
MobManager.getName(LivingEntity entity)
This method gets the vanilla name of the entity (such as Zombie Pigmen, Slime, or Wither Skeleton) this would primarily be used for displaying mob names or matching it up to a config for more accurate names
MobManager.getDetailedName(LivingEntity entity)
This method gets the name from the previous method, but adds attributes in front of it to give a clear idea of what the mob is. The attributes it can include are the following:
Wolf/Ocelot Tamed Status
- Tamed = the entity is tamed
- Wild = the entity is not tamed
Slime Size
- Big = largest slime
- Small = middle-sized slime
- Tiny = smallest slime
Sheep
It provides the color name (such as Red or Blue)
Villager
- Blacksmith (Brown shirt with black apron)
- Butcher (Brown shift with white apron)
- Farmer (Brown shirt)
- Librarian (White shirt)
- Priest (Purple Shirt)
Zombie
- Villager = The zombie is a villager zombie
Babies
- Baby = the mob is a baby (applies to chickens, cows, mooshrooms, ocelots, pigs, sheep, villagers, wolves, and zombies)
Enchantments
The methods for enchantment name conversions go through the "Enchants" class and include the following:
Enchants.getVanillaName(String bukkitName)
This converts a bukkit enchantment name into a vanilla one (e.g. DAMAGE_ALL -> Sharpness)
Enchants.getVanillaName(Enchantment enchant)
This is the same as the previous except it takes the name straight from an enchantment
Enchants.getBukkitName(String vanillaName)
This converts a vanilla name back to a bukkit name (useful for config conversions or creating an enchantment from a vanilla name)
Items
Item name conversions are not yet complete, but many items work already. The conversion goes through the "ItemManager" class and has the following:
ItemManager.getVanillaName(String bukkitName)
This gets the vanilla name for the given bukkit name (e.g. YELLOW_FLOWER -> Dandelion)
ItemManager.getVanillaName(Material type)
Same thing as the previous, just gets the name from a material
ItemManager.getVanillaName(String bukkitName, short damage)
This gets the vanilla name for the given bukkit name with a specific damage ID (e.g. WOOL + 1 -> Orange Wool)
ItemManager.getVanillaName(Material type, short damage)
Same thing as the previous, just gets the name from a material
ItemManager.getVanillaName(ItemStack item)
Same thing as the previous, just gets the material and damage from the item stack
Comments