Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.tomaskoYT.Zkouska;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin {
- /* mod_prist typ název(parametry){
- * tělo metody}
- */
- public void onEnable (){
- getLogger().info("Plugin byl zapnut");
- getCommand("spawn").setExecutor(this);
- // String = "řetězec";
- // /ahoj arg0 arg1 arg2 argN
- // Command Argumenty
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
- if (cmd.getName().equalsIgnoreCase("Spawn")){
- if (sender instanceof Player){
- Player p = (Player) sender;
- p.sendMessage("Vitej u nas, doufame ze si uzijes hru :)");
- }
- }
- // Typ název = hodnota;
- /*
- * (podmínka) přikaz;{
- * blok kodu
- * }
- *
- */
- return false;
- }
- public void onDisable(){
- getLogger().info("Plugin byl vypnut");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement