My pluggin doesnt work and im brand new to coding and pluggins, help?

Discussion in 'Plugin Development' started by NightPhoenix66, Aug 14, 2017.

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

    NightPhoenix66

    here is my code... and idk how to make it work on a private server...

    upload_2017-8-14_12-0-55.png
    upload_2017-8-14_12-1-53.png

    YAML

    upload_2017-8-14_12-3-12.png

    Build XML

    upload_2017-8-14_12-3-52.png

    please help.... I'm bad...
     
  2. Offline

    Zombie_Striker

    @NightPhoenix66
    1. Your main class should not be called 'main', and should should start with an uppercase letter.
    2. You can only have one onCommand. That is the reason everything is underlined.
    3. You can't make up arguments. The second variable in the onCommand must be a Command object.
    4. You can not have duplicate commands in the plugin.yml. Replace all "mycommands" with the actual command name.
    5. You have a ton of syntax errors. You need to know java before you work on bukkit, or else things like this happen. Take some time to learn Java by itself and then come back to bukkit. You can find tutorials here if you do not have a base-java tutorial aready.
     
    A5H73Y likes this.
  3. Offline

    kingmo100

    i think he was joking

    1. main is not the class name and the first letter should be capitalized it should be
    Code:
    public class Planeride
    2. Try to import all your stuff with control + shift + o
    3. next time click the plus sign next to the imports so we can see the imports.
    4. only 1 oncommand per class. to make 2 commands have another class and make an executor there are tons of vids online for this
    5. its @Override not @override
    6. the onCommand function is
    Code:
     onCommand(Sender sender, Command cmd, CommandLabel label, String[] args) {} 
    sender is either a player or console you did that correctly.
    Command is not the command u want to run it is the way u check what command the player ran for example
    Code:
    if(cmd.equalsIgnoreCase("fly")){}
    and the player typed in /fly then they would do whatever is in the curly braces.
    I never use CommandLabels google if u really need help
    and the String[] args is an Array of strings that come after the initial command
    so lets say they type /fly kingmo100
    that would fill one of the parts of the Array.
    7. When Casting Player to sender you need to capitalize Player
    8. When checking if the Sender is an instance of a Player it has to be capitalized.
    9. player.isGliding & player.setVehicle() need semicolons
    10. player.isGliding returns a boolean and wont do anything to the player;
    11.Re read your code
    12. I suggest you learn java and become an expert before you even look at plugin development.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited: Aug 16, 2017
  4. Offline

    timtower Administrator Administrator Moderator

    @kingmo100 Joking about what?
    1. main is the class name in this case.
    6. Actually it is onCommand(CommandSender sender, Command cmd, String label, String[] args)
    And the sender can also be a commandblock
    cmd.equalsIgnoreCase("fly") will not compile, it will be cmd.getName().equalsIgnoreCase("fly")
     
  5. Offline

    kingmo100

    I use multiple classes and main is not the class name if you could read The filename is planeride.
    I have never used a commandblock just trying to provide the info I know
    I said he was joking bc theres so many errors that are bc he just didnt try
    like @ovverride if he spend 1 minunt looking at it he would know that its differenct from the first one were he spelled it correctly
     
Thread Status:
Not open for further replies.

Share This Page