java - Using multiple classes for commands, command not working? -


hopefully guys can me fix this. i'm sorta new java, , new bukkitapi. learn best going ahead , attempting projects, , doing tons of research when can't figure out.

i've looked around, , cannot figure out why isn't working. i'm attempting make plugin, , utilizing multiple classes organization , cleanliness. i'm typing how should typed, , have been going off of this tutorial here. bit old, things might have changed. problem is, when run command, no errors yet doesn't anything. says "alj23 issued server command: /hello (which command temporary until fix this) in console, yet nothing happens. no message in chat, no nothing. no errors in console. it's suppose send player issued command message saying "hello there!" (also temporary right now.) don't know why works.

i'm still learning, i'm doing blatantly wrong. might following bad practices or doing unneeded things, if so, amazing if point them out.

my main class:

package me.alj23.rpgclasses;  import org.bukkit.event.listener; import org.bukkit.plugin.java.javaplugin;  public class rpgclassesmain extends javaplugin implements listener  { public void onenable() {     this.getcommand("hello").setexecutor(new warriorinfo(this)); }  public void ondisable() {  } 

the class executes code command:

package me.alj23.rpgclasses;  import org.bukkit.command.command; import org.bukkit.command.commandexecutor; import org.bukkit.command.commandsender; import org.bukkit.entity.player;  public class warriorinfo implements commandexecutor { rpgclassesmain plugin;  public warriorinfo (rpgclassesmain passedplugin) {     this.plugin = passedplugin; }  @override public boolean oncommand(commandsender sender, command cmd, string label,string[] arg3)  {     player player = (player) sender;      player.sendmessage("hello there!");   return false }  } 

plugin.yml:

 name: rpgclasses  version: 1.0  main: me.alj23.rpgclasses.rpgclassesmain  description: choose beyond wide scope of classes!  commands:  hello:  description: placeholder! 

look @ onenable , ondisable methods. according java conventions (and bukkit api), methods should named onenable , ondisable, respectively. misspelling caused command never register in first place.

also, correct indentation must yaml files. should this:

name: rpgclasses version: 1.0 main: me.alj23.rpgclasses.rpgclassesmain description: choose beyond wide scope of classes! commands:   hello:     description: placeholder! 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -