Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.josh.DicePlugin;
- import java.util.Random;
- import java.util.logging.Logger;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.plugin.java.JavaPlugin;
- public class DicePlugin extends JavaPlugin{
- protected FileConfiguration config;
- static final Logger log = Logger.getLogger("Minecraft");
- public void onEnable(){
- log.info("Your plugin has been enabled!");
- config = getConfig();
- this.getConfig().set("dice.running", true);
- this.getConfig().set("dice.enabled", "yes");
- this.getConfig().set("dice.range", 6);
- }
- public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
- if(cmd.getName().equalsIgnoreCase("roll")){ // If the player typed /basic then do the following...
- sender.sendMessage(number + "");
- return true;
- } //If this has happened the function will break and return true. if this hasn't happened the a value of false will be returned.
- return false;
- }
- public void onDisable(){
- log.info("Dice Plugin has been disabled.");
- }
- Random dice = new Random();
- int number;{
- for (int counter=1; counter<=10;counter++)
- number = 1+dice.nextInt(6);}
- }
Add Comment
Please, Sign In to add comment