[FUN] In-game chat number gen. [1.2.5R1]

Discussion in 'Inactive/Unsupported Plugins' started by Buskaroo, May 9, 2012.

  1. Offline


    Some guy asked me earlier to make a plugin that generated random numbers in the chat, for competition purposes:

    So I did, since it was so easy and small I'm just going to release the source code for educational purposes released under the public domain.

    package rollRandom;
    import java.util.Random;
    import java.util.logging.Logger;
    import org.bukkit.OfflinePlayer;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    public class rollRandom extends JavaPlugin
    public void onEnable()
    log = this.getLogger();
    log.info("Your plugin has been enabled!");
    Logger log;
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
    Player player = null;
    if (sender instanceof Player)
    player = (Player) sender;
    Random rand = new Random();
            int num = rand.nextInt(101);
            log = this.getLogger();       
    sender.sendMessage("Generated Random Number between 0 to 100 is : " + num);     
    return false;
    public void onDisable()
    log.info("Your plugin has been disabled.");
    Download for plugin: <Edit by Moderator: Redacted mediafire url>

    Command for use: /roll

    Image of use: [​IMG]
    Last edited by a moderator: Nov 10, 2016

Share This Page