Hopefully you guys can help me fix this. I'm sorta new to Java, and very new to the BukkitAPI. I learn best by just going ahead and attempting projects, and then doing tons of research when I can't figure something out.
I've looked all around, and I cannot figure out why this isn't working. I'm attempting to make a plugin, and am utilizing multiple classes for organization and cleanliness. I'm typing everything how it should be typed, and have been going off of this tutorial here. It is a bit old, so some things might have changed. The problem is, when I run the command, I get no errors yet it just doesn't do anything. It says "Alj23 issued the server command: /hello (which is my command temporary until I fix this) in the console, yet nothing happens. No message in chat, no nothing. No errors in the console. It's suppose to send the player who issued the command a message saying "Hello there!" (also temporary for right now.) I just don't know why it works.
I'm still learning, so I'm most likely doing something blatantly wrong. I also might be following bad practices or doing unneeded things, so if so, it would be amazing if you could 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 that executes the code for the 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 a wide scope of classes!
commands:
hello:
description: placeholder!