can someone pls give me a simple plugin to make... if i can make it then i know i can continue on my quest lol
Try making a plugin (for yourself) that returns a message when a command is used. Here, I'll start you off: Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler Code: package me.Bush.FIRSTPlugin; // Importing stuff import java.util.logging.Logger; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; //main method public class FIRSTPlugin extends JavaPlugin { //log messages to console Logger log = Logger.getLogger("Minecraft"); //version number double version = 0.1; //when plugin is enabled public void onEnable(){ //print to system "FIRSTPlugin" + double version + " - Enabled" System.out.println("FIRSTPlugin " + version + " - Enabled"); } //when plugin is disabled public void onDisable(){ //Same as enabled System.out.println("FIRSTPlugin " + version + " - Disabled"); } //grab player commands public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ //if message sender is a player if(sender instanceof Player){ //if command = "hai" if(cmd.getName().equalsIgnoreCase("hai")){ Player player = (Player) sender; //send player message "ohhai" player.sendMessage("ohhai"); return true; } } return false; } }
Try making a godmode plugin like I said above, Hint: (Move your mouse to reveal the content) Hint: (open) Hint: (close) 1. Add player to an ArrayList onCommand 2. Create an EntityListener 3. Call the event EntityDamage 4. Check if they are in the ArrayList 5. If they are, event.setCancelled(true); Example Main Class only check if stuck Code:java package me.Bush.GodMode; import org.bukkit.plugin.JavaPlugin;import java.util.logging.Logger;import org.bukkit.command.CommandSender;import org.bukkit.command.Command;import ArrayList (I forget the import);import Priority (Don't remember import); public class GodMode extends JavaPlugin { public Logger log = Logger.getLogger("Minecraft"); public ArrayList godmode = new ArrayList(this); public final GodModeEntityListener entityListener = new GodModeEntityListener(this); public void onEnable() { log.info("[GodMode] Plugin Enabled."); PluginManager pm = pluginManager.getPluginManager(); pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, event.Priority.Low, this); } public void onDisable() { log.info("[GodMode] Plugin Disabled."); } public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (command.getName().equalsIgnoreCase("god") { Player s = (Player) sender; if (!godmode.contains(s)) { godmode.add(s); s.sendMessage("You are now god."); } else { s.sendMessage("You are already god."); } } if (command.getName().equalsIgnoreCase("ungod") { Player s = (Player) sender; if (godmode.contains(s)) { godmode.remove(s); s.sendMessage("You are no longer god."); } else { s.sendMessage("You are not god."); } } }} I may of made a few small errors (spelling, capitals, and such) but eclipse will catch them If you need more help just add me on skype, dbizzzle
Bro its so easy its not even funny, when people look at code they freak out but if you get to know it
It helps if you have done previous coding before but if your starting of you may as well start with java.
Well its always possible but i am pretty good with C# which is basically the same as java, less then 1hr after installing eclipse i had made my first plugin (Bucket furnace)
This is what i use to help me out with code http://jd.bukkit.org/apidocs/src-html/org/bukkit/command/defaults/Command.html