Need help to find what is wrong

Status
This thread has been locked.
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
try it as getCommand() without the plugin before it
like instead of plugin.getCommand() just use getCommand()
 

Dialogues

Premium
Feedback score
5
Posts
41
Reactions
33
Resources
0
this.plugin = plugin;
plugin.getCommand("Hello").setExecutor(this);


I believe you would put this in the main onEnable in your Main.java class.
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
Also there is no need to use a getCommand() method if the command is in the main class.
 

felldownstairs

Gypsy Boy | Java Developer
Supreme
Feedback score
4
Posts
783
Reactions
144
Resources
0
Sorry I read all incorrectly, ye do what Dialogues said and put it in the onEnable in your main class and replace this with new HelloCmd()
 

William

Developer
Supreme
Feedback score
10
Posts
389
Reactions
189
Resources
0
just put in ur main class lmao it wont kill u[DOUBLEPOST=1508852871][/DOUBLEPOST]if you have nothing in the main class pointing to that class how do you expect it to reach that?
 

Dialogues

Premium
Feedback score
5
Posts
41
Reactions
33
Resources
0
plugin = this;
HelloCmd hc = new HelloCmd();
getCommand("Hello").setExecutor(hc);


Try this. I'm new too so probably wont work!
 

Kralley

Feedback score
1
Posts
93
Reactions
22
Resources
0
If you're new to java, learn java before coding plugins
I'm not even into Java, but I'm pretty sure he learns a lot from trying or playing around with it. Learning and trying makes perfect. Whenever I made my first server I was terrible at it but I learned a lot of stuff. I wouldn't be at this point without trying and playing around with it.
 
Last edited:

Kralley

Feedback score
1
Posts
93
Reactions
22
Resources
0
You can't really play around with spigot when you don't even know basics of java.
If you're gonna "play around" with it, at least find out the basics.

Making servers is a lot lot different to coding plugins. When coding plugins you have to actually learn the language then learn how to code the thing in that language. Making servers is simple > you just install plugins and configure them.
Well I sort of agree with you. As what I see he already knows basics. I've heard from a lot of friends who do develop plugins and does well with programming, that they started playing around with it and learning from errors and bugs. Whenver you learn other languages such as german, english etc. you also start from the basics and learn from your mistakes. I sort of understand what you mean tho! Wasn't really what I meant with making servers. What ever, have a nice day :)
 

DatAyy

Premium
Feedback score
12
Posts
491
Reactions
109
Resources
0
You can't really play around with spigot when you don't even know basics of java.
If you're gonna "play around" with it, at least find out the basics.

Making servers is a lot lot different to coding plugins. When coding plugins you have to actually learn the language then learn how to code the thing in that language. Making servers is simple > you just install plugins and configure them.
where should i start then with java since i'm watching tutorials right now but parts of them don't work.
 

sores

MineBOI
Premium
Feedback score
5
Posts
305
Reactions
210
Resources
0
If you're still looking for help use this.

public void onEnable(){
plugin = this;
getServer().getPluginManager().registerEvents(this, this); <- If you're creating events in your plugin.

loadCommands();
}

After you've done that create the loadCommands void.

public void loadCommands(){
getCommand("yourcommandhere").setExecutor(new NameOfClassHere(this));
}

This should all be done in your main class btw.
 
Status
This thread has been locked.
Top