Skip to content

Version-independent names ​

Bukkit renamed materials, sounds, particles, potions and enchantments many times between 1.8 and 26.x. EranoAPI has one enum per area with every value of the newest Minecraft by its newest name; on each server it resolves to what that server calls it.

EnumWhat changedOn old servers
EranoMaterial1.13 flattening, 14 renames after1.8 - 1.12: old name + data value (RED_WOOL → WOOL:14)
EranoSoundRenamed in 1.9 and 1.13; an interface since 1.21.2ENTITY_PLAYER_LEVELUP → LEVEL_UP on 1.8
EranoParticleNo API on 1.8, renamed in 1.20.51.8: EranoAPI sends the packet
EranoEffectWorld effects added over timetells which server has which
EranoPotionEffectRenamed in 1.20.5STRENGTH → INCREASE_DAMAGE
EranoPotionTypePotion items differ in 1.8, 1.9, 1.20.2data value, PotionData or the type
EranoEnchantmentKeys in 1.13, renamed in 1.20.5SHARPNESS → DAMAGE_ALL

Common methods ​

java
EranoX.NAME.parseX();          // the server's value, null when it doesn't have it
EranoX.NAME.isSupported();
EranoX.match("old_name");      // today's name, older names, minecraft: keys; case-insensitive
EranoX.of(serverValue);        // back to the constant

Materials ​

java
ItemStack wool = EranoMaterial.RED_WOOL.parseItem(16);
EranoMaterial.match("WOOL:14");                 // also "minecraft:red_wool", "WOOD_SWORD", "A|B"
EranoMaterial kind = EranoMaterial.of(player.getItemInHand());   // data value included on 1.8
EranoMaterial.GRANITE.setType(block);           // STONE:1 on 1.8

Sounds ​

java
EranoSound.ENTITY_PLAYER_LEVELUP.play(player, 1f, 1f);       // to one player
EranoSound.ENTITY_GENERIC_EXPLODE.play(location, 1f, 1f);    // to everyone nearby

Sounds Minecraft renamed are matched by the sound files Mojang plays, so BLOCK_NOTE_BLOCK_PLING on 1.8 is exactly 1.8's NOTE_PLING.

Particles ​

java
EranoParticle.HAPPY_VILLAGER.spawn(location, 10, 0.5, 0.5, 0.5, 0);
EranoParticle.DUST.spawn(location, 1, 0, 0, 0, 0, Color.AQUA);                  // colored dust, 1.8 too
EranoParticle.BLOCK.spawn(location, 30, 0.3, 0.3, 0.3, 0, EranoMaterial.RED_WOOL);
EranoEffect.STEP_SOUND.play(location, Material.STONE);

Data is given the same way on every version and converted: a Color, a Material, an EranoMaterial or an ItemStack; or the server's own type (BlockData, DustOptions).

Potions and enchantments ​

java
EranoPotionEffect.STRENGTH.apply(player, 200, 1);       // Strength II, 10 s
ItemStack potion = EranoPotionType.LONG_SWIFTNESS.parseItem(EranoPotionType.Form.SPLASH, 1);
EranoEnchantment.SHARPNESS.enchant(sword, 2);

Reference tables ​

Every value, when it came and what it was called, generated from Spigot's and Mojang's data: Material.md, Sound.md, Particle.md, Potion.md, Enchantment.md.

SurvivalGames is a paid plugin. EranoAPI is open source under the MIT license.