Solved No legacy enum constant for WOODEN_SWORD ???

Discussion in 'Spigot Plugin Development' started by Spjiuh435, Sep 12, 2019 at 3:22 AM.

  1. I updated my 1.8 plugin to 1.14.4.
    One of the errors i get is this one:

    [Server] Server thread/ERROR Fatal error trying to convert System v0.1:me/dev/system/listener/Respawn_Event.class 11.09 22:18:14 [Server] INFO org.bukkit.plugin.AuthorNagException: No legacy enum constant for WOODEN_SWORD. Did you forget to define api-version: 1.13 in your plugin.yml?

    The code is just:

    public class Respawn_Event implements Listener{

    @EventHandler
    public void onRespawn(PlayerRespawnEvent e){
    e.getPlayer().getInventory().addItem(new ItemStack(Material.WOODEN_SWORD, 1));
    }

    }


    What did i do wrong???
     
  2. Well, your error tells you exactly what you did wrong.
    You forgot to define the API version in your plugin.yml
     
    • Like Like x 1
    • Agree Agree x 1
    • Winner Winner x 1