1.13 Material IDs

Discussion in 'Spigot Plugin Development' started by Eliminator, Aug 1, 2018.

  1. My plugin configs use IDs, but Item IDs do not work in 1.13 now.

    How can I get the Material name from the old ID now?
     
  2. The idea of using arbitrary values to represent things (known as magic values) is generally bad practice, hence why they were deprecated.
    My suggestion would simply be to update your plugin to use the proper item IDs and to stop supporting numeric IDs. The new IDs are more easily understood than a simple number, so I figured that would be idea for a config.

    It's possible to create a compatibility layer, and I'm sure some have been done already. Something worth looking up if you're intent on using deprecated methods. In fact, just recently someone posted one here
     
  3. joehot200

    Supporter

    You would have to manually write a list of every ID, specifying which material it represented for different versions.
     
  4. You can probably write a small script to dump all the info if you use the 1.12.2 API. Shouldn't even need to be a plugin, just a small console app that uses Bukkit and prints all the enum stuff to a file.

    Of course then you'd need to either make up IDs for the new blocks or just leave them out.