Minecraft PC IP: play.cubecraft.net

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,166
518
Kepler-452b
Hi! I'm aking a plugin....
package mjs.minecraft.plugin.hello;

import java.util.logging.Logger;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class HelloPlugin extends JavaPlugin {

public static final Logger log = Logger.getLogger("Minecraft");

@Override
public void onDisable() {
PluginManager pluginManager = getServer().getPluginManager();
log.info("Hello plugin has been disabled.");
}

@Override
public void onEnable() {
log.info("Plugin has been enabled!");
}

@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {

if(label.equals("hello")) {
Player player = (Player) sender;
player.sendMessage("Hello " + player.getDisplayName());
return true;
}

return false;
}
}
name: MHello
main: mjs.minecraft.plugin.hello.HelloPlugin
version: 0.1
author: Hangar555
website:
description: Example command to say hello to the user

commands:
hello:
description: Say hello to the user.
usage: /hi
 

Dan:

Well-Known Member
Aug 20, 2015
334
223
118
25
California, USA
danbeneventano.me
  • Change "label.equals" to "command.getName().equalsIgnoreCase"
  • Remove the website from the yml because you're not using.
  • Change the logger to "this.getLogger()"
  • In onEnable put "this.getCommand("hello").setExecutor(this::onCommand);" (if you're running Java 8)
  • Add "if(sender instanceof Player)" where you create the player
 

Mattuki

Well-Known Member
Mar 21, 2015
455
172
118
28
  • Change "label.equals" to "command.getName().equalsIgnoreCase"
  • Remove the website from the yml because you're not using.
  • Change the logger to "this.getLogger()"
  • In onEnable put "this.getCommand("hello").setExecutor(this::eek:nCommand);" (if you're running Java 8)
  • Add "if(sender instanceof Player)" where you create the player
can you explain us ? plsssssss
 
Members Online

Latest posts

Latest profile posts

AnolTongi wrote on Hqteful's profile.
Genuinely thank you for everything you've done, you're very much appreciated. Hope to see you around!
LorilambtheWcubecraftian wrote on Hqteful's profile.
Thanks for all ur help as mod! Enjoy your ccg retirement!! 💛
Kazwa wrote on Hqteful's profile.
Thanks for everything!
iTz1Hamood wrote on Hqteful's profile.
Thanks for everything, Mika. It honestly won’t be the same without you. I’m wishing you all the best in whatever comes next!! You truly deserve all the good things in life 🤍 I’ll always be grateful to you. You accepted my helper app, got me here.. and that meant alooot for me. Will miss you so much!! You’ve had such a positive impact on so many of us. Take care and stay amazing 💙
llvqs wrote on Hqteful's profile.
Thanks for everything and good luck with everything! 💙🧡
Top Bottom