Problem in my item plugin.

Discussion in 'Plugin Development' started by JoltTheBolt, Dec 22, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    JoltTheBolt

    upload_2020-12-23_12-33-18.png

    Can anyone please tell me what is wrong in this? It just doesn't load. It says 0 plugins in the server.
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    JoltTheBolt

  4. Online

    timtower Administrator Administrator Moderator

    [12:54:49 ERROR]: Could not load 'plugins\JoltItems-0.0.1-SNAPSHOT.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `io.github.JoltTheBolt.JoltItems.JoltItems'
    Needs to be io.github.JoltTheBolt.joltitems.JoltItems in your plugin.yml
     
  5. Offline

    JoltTheBolt

    Thank YOU so much for your help so far. However, another error has occurred: Another... - Pastebin.com
     
  6. Online

    timtower Administrator Administrator Moderator

    @JoltTheBolt Probably because you are using an inventory that you never made.
     
  7. Offline

    JoltTheBolt

    Yep, How do I fix it then? Player.getInventory(); doesn't work for me. There is a red underline on Player
     
  8. Online

    timtower Administrator Administrator Moderator

    @JoltTheBolt Check if the sender is a player, then cast to one, then get that inventory.
     
  9. Offline

    JoltTheBolt

    I fixed it by doing:
    Code:
    Player player = (Player) sender;
    Inventory inventory = player.getInventory();
    inventory.addItem(Incinerator);
    Thanks for your help!
     
  10. Online

    timtower Administrator Administrator Moderator

    Now run in the console and see the ClassCastException
     
Thread Status:
Not open for further replies.

Share This Page