Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.SirMonkeyFood.SMTreasureHunt;
- import java.util.Random;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.block.Chest;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.plugin.java.JavaPlugin;
- public class TreasureHunt extends JavaPlugin{
- public static TreasureHunt plugin;
- public void onEnable(){
- getLogger().info("SMTreasureHunt Is Enabled!");
- plugin = this;
- }
- public void onDisable(){
- getLogger().info("SMTreasureHunt is Disabled");
- plugin = null;
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
- if (cmd.getName().equalsIgnoreCase("THcreate")){
- if (sender.hasPermission("TreasureHunt.use")){
- Player admin = (Player)sender;
- Location loc = admin.getPlayer().getLocation();
- Location loc1 = admin.getPlayer().getLocation();
- loc1.setX(loc1.getX() -1);
- Location loc2 = admin.getPlayer().getLocation();
- loc2.setX(loc2.getX() +1);
- Location loc3 = admin.getPlayer().getLocation();
- loc3.setZ(loc3.getZ() -1);
- Location loc4 = admin.getPlayer().getLocation();
- loc4.setZ(loc4.getZ() +1);
- Location loc5 = admin.getPlayer().getLocation();
- loc5.setX(loc5.getX() -1);
- loc5.setZ(loc5.getZ() -1);
- Location loc6 = admin.getPlayer().getLocation();
- loc6.setX(loc6.getX() +1);
- loc6.setZ(loc6.getZ() -1);
- Location loc7 = admin.getPlayer().getLocation();
- loc7.setX(loc7.getX() - 1);
- loc7.setZ(loc7.getZ() + 1);
- Location loc8 = admin.getPlayer().getLocation();
- loc8.setX(loc8.getX() +1);
- loc8.setZ(loc8.getZ() +1);
- Location loc9 = admin.getPlayer().getLocation();
- loc9.setX(loc9.getX() +1);
- loc9.setY(loc9.getY() +1);
- Location loca = admin.getPlayer().getLocation();
- loca.setX(loca.getX() -1);
- loca.setY(loca.getY() +1);
- Location locb = admin.getPlayer().getLocation();
- locb.setZ(locb.getZ() +1);
- locb.setY(locb.getY() +1);
- Location locc = admin.getPlayer().getLocation();
- locc.setZ(locc.getZ() -1);
- locc.setY(locc.getY() +1);
- Location locd = admin.getPlayer().getLocation();
- locd.setY(locd.getY() +2);
- Location locchest = admin.getPlayer().getLocation();
- locchest.setY(locchest.getY() +3);
- Location locf = admin.getPlayer().getLocation();
- locf.setY(locf.getY() +4);
- Location locg = admin.getPlayer().getLocation();
- locg.setZ(locg.getZ() +2);
- locg.setY(locg.getY() -1);
- Location loch = admin.getPlayer().getLocation();
- loch.setZ(loch.getZ() -2);
- loch.setY(loch.getY() -1);
- Location loci = admin.getPlayer().getLocation();
- loci.setX(loci.getX() +2);
- loci.setY(loci.getY() -1);
- Location locj = admin.getPlayer().getLocation();
- locj.setX(locj.getX() -2);
- locj.setY(locj.getY() -1);
- Location lock = admin.getPlayer().getLocation();
- lock.setX(lock.getX() -2);
- lock.setZ(lock.getZ() -2);
- lock.setY(lock.getY() -1);
- Location locl = admin.getPlayer().getLocation();
- locl.setX(locl.getX() +2);
- locl.setZ(locl.getZ() -2);
- locl.setY(locl.getY() -1);
- Location locm = admin.getPlayer().getLocation();
- locm.setX(locm.getX() +2);
- locm.setZ(locm.getZ() +2);
- locm.setY(locm.getY() -1);
- Location locn = admin.getPlayer().getLocation();
- locn.setX(locn.getX() -2);
- locn.setZ(locn.getZ() +2);
- locn.setY(locn.getY() -1);
- Location loco = admin.getPlayer().getLocation();
- loco.setX(loco.getX() -1);
- loco.setZ(loco.getZ() +2);
- loco.setY(loco.getY() -1);
- Location locp = admin.getPlayer().getLocation();
- locp.setX(locp.getX() +1);
- locp.setZ(locp.getZ() +2);
- locp.setY(locp.getY() -1);
- Location locq = admin.getPlayer().getLocation();
- locq.setX(locq.getX() -1);
- locq.setZ(locq.getZ() -2);
- locq.setY(locq.getY() -1);
- Location locr = admin.getPlayer().getLocation();
- locr.setX(locr.getX() +1);
- locr.setZ(locr.getZ() -2);
- locr.setY(locr.getY() -1);
- Location locs = admin.getPlayer().getLocation();
- locs.setX(locs.getX() +2);
- locs.setZ(locs.getZ() -1);
- locs.setY(locs.getY() -1);
- Location loct = admin.getPlayer().getLocation();
- loct.setX(loct.getX() +2);
- loct.setZ(loct.getZ() +1);
- loct.setY(loct.getY() -1);
- Location locu = admin.getPlayer().getLocation();
- locu.setX(locu.getX() -2);
- locu.setZ(locu.getZ() -1);
- locu.setY(locu.getY() -1);
- Location locv = admin.getPlayer().getLocation();
- locv.setX(locv.getX() -2);
- locv.setZ(locv.getZ() +1);
- locv.setY(locv.getY() -1);
- Location locw = admin.getPlayer().getLocation();
- locw.setX(locw.getX() -2);
- locw.setZ(locw.getZ() -2);
- Location locx = admin.getPlayer().getLocation();
- locx.setX(locx.getX() +2);
- locx.setZ(locx.getZ() -2);
- Location locy = admin.getPlayer().getLocation();
- locy.setX(locy.getX() +2);
- locy.setZ(locy.getZ() +2);
- Location locz = admin.getPlayer().getLocation();
- locz.setX(locz.getX() -2);
- locz.setZ(locz.getZ() +2);
- Location loc0 = admin.getPlayer().getLocation();
- loc0.setY(loc0.getY() +5);
- loc1.getBlock().setType(Material.SMOOTH_BRICK);
- loc2.getBlock().setType(Material.SMOOTH_BRICK);
- loc3.getBlock().setType(Material.SMOOTH_BRICK);
- loc4.getBlock().setType(Material.SMOOTH_BRICK);
- loc5.getBlock().setType(Material.SMOOTH_BRICK);
- loc6.getBlock().setType(Material.SMOOTH_BRICK);
- loc7.getBlock().setType(Material.SMOOTH_BRICK);
- loc8.getBlock().setType(Material.SMOOTH_BRICK);
- loc9.getBlock().setType(Material.SMOOTH_BRICK);
- loca.getBlock().setType(Material.SMOOTH_BRICK);
- locb.getBlock().setType(Material.SMOOTH_BRICK);
- locc.getBlock().setType(Material.SMOOTH_BRICK);
- locd.getBlock().setType(Material.SMOOTH_BRICK);
- locchest.getBlock().setType(Material.CHEST);
- locg.getBlock().setType(Material.NETHERRACK);
- loch.getBlock().setType(Material.NETHERRACK);
- loci.getBlock().setType(Material.NETHERRACK);
- locj.getBlock().setType(Material.NETHERRACK);
- lock.getBlock().setType(Material.NETHERRACK);
- locl.getBlock().setType(Material.NETHERRACK);
- locm.getBlock().setType(Material.NETHERRACK);
- locn.getBlock().setType(Material.NETHERRACK);
- loco.getBlock().setType(Material.NETHERRACK);
- locp.getBlock().setType(Material.NETHERRACK);
- locq.getBlock().setType(Material.NETHERRACK);
- locr.getBlock().setType(Material.NETHERRACK);
- locs.getBlock().setType(Material.NETHERRACK);
- loct.getBlock().setType(Material.NETHERRACK);
- locu.getBlock().setType(Material.NETHERRACK);
- locv.getBlock().setType(Material.NETHERRACK);
- locw.getBlock().setType(Material.FIRE);
- locx.getBlock().setType(Material.FIRE);
- locy.getBlock().setType(Material.FIRE);
- locz.getBlock().setType(Material.FIRE);
- loc.getBlock().setType(Material.ENDER_PORTAL_FRAME);
- admin.getWorld().strikeLightning(locw);
- admin.getWorld().strikeLightning(locx);
- admin.getWorld().strikeLightning(locy);
- admin.getWorld().strikeLightning(locz);
- admin.getWorld().strikeLightning(locw);
- admin.getWorld().strikeLightning(locx);
- admin.getWorld().strikeLightning(locy);
- admin.getWorld().strikeLightning(locz);
- admin.getWorld().strikeLightning(locw);
- admin.getWorld().strikeLightning(locx);
- admin.getWorld().strikeLightning(locy);
- admin.getWorld().strikeLightning(locz);
- admin.getWorld().strikeLightning(locw);
- admin.getWorld().strikeLightning(locx);
- admin.getWorld().strikeLightning(locy);
- admin.getWorld().strikeLightning(locz);
- admin.getWorld().strikeLightning(locw);
- admin.getWorld().strikeLightning(locx);
- admin.getWorld().strikeLightning(locy);
- admin.getWorld().strikeLightning(locz);
- admin.teleport(loc0);
- Random ChestLevel = new Random();
- int maxLength = 10;
- int level = ChestLevel.nextInt(maxLength);
- Random contents = new Random();
- int items = contents.nextInt(100);
- Random contents1 = new Random();
- int items1 = contents1.nextInt(100);if(level == 0){
- locf.getBlock().setType(Material.DIAMOND_BLOCK);
- }
- if(level == 1 || level == 2 || level == 3){
- locf.getBlock().setType(Material.GOLD_BLOCK);
- }
- if(level > 3 && level < maxLength){
- //FIRST ITEM
- Bukkit.broadcastMessage(ChatColor.GOLD + "[" + ChatColor.GREEN + "TreasureHunt" + ChatColor.GOLD + "]" + ChatColor.GRAY + " A" + ChatColor.YELLOW + " Common " + ChatColor.GRAY + "Treasure Chest Has Been Spawned!");
- locf.getBlock().setType(Material.IRON_BLOCK);
- if(items >= 0 && items <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items >= 20 && items <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items >= 60 && items <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items >= 85 && items <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items >= 90 && items <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //SECOND ITEM
- if(items1 >= 0 && items1 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items1 >= 20 && items1 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items1 >= 60 && items1 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items1 >= 85 && items1 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items1 >= 90 && items1 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //THIRD ITEM
- Random contents2 = new Random();
- int items2 = contents2.nextInt(100);
- if(items2 >= 0 && items2 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items2 >= 20 && items2 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items2 >= 60 && items2 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items2 >= 85 && items2 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items2 >= 90 && items2 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //FOURTH ITEM
- Random contents3 = new Random();
- int items3 = contents3.nextInt(100);
- if(items3 >= 0 && items3 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items3 >= 20 && items3 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items3 >= 60 && items3 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items3 >= 85 && items3 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items3 >= 90 && items3 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //FIFTH ITEM
- Random contents4 = new Random();
- int items4 = contents4.nextInt(100);
- if(items4 >= 0 && items4 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items4 >= 20 && items4 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items4 >= 60 && items4 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items4 >= 85 && items4 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items4 >= 90 && items4 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //SIXTH ITEM
- Random contents5 = new Random();
- int items5 = contents5.nextInt(100);
- if(items5 >= 0 && items5 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items5 >= 20 && items5 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items5 >= 60 && items5 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items5 >= 85 && items5 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items5 >= 90 && items5 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //SEVENTH ITEM
- Random contents6 = new Random();
- int items6 = contents6.nextInt(100);
- if(items6 >= 0 && items6 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items6 >= 20 && items6 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items6 >= 60 && items6 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items6 >= 85 && items6 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items6 >= 90 && items6 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //EIGTH ITEM
- Random contents7 = new Random();
- int items7 = contents7.nextInt(100);
- if(items7 >= 0 && items7 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items7 >= 20 && items7 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items7 >= 60 && items7 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items7 >= 85 && items7 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items7 >= 90 && items7 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //NINTH ITEM
- Random contents8 = new Random();
- int items8 = contents8.nextInt(100);
- if(items8 >= 0 && items8 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items8 >= 20 && items8 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items8 >= 60 && items8 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items8 >= 85 && items8 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items8 >= 90 && items8 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- //TENTH ITEM
- Random contents9 = new Random();
- int items9 = contents9.nextInt(100);
- if(items9 >= 0 && items9 <= 19){
- Random redstoneamount = new Random();
- int rsamount = redstoneamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.REDSTONE, rsamount + 1));
- } else {
- if(items9 >= 20 && items9 <= 59){
- Random breadamount = new Random();
- int bdamount = breadamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, bdamount + 1));
- } else {
- if(items9 >= 60 && items9 <= 84){
- Random coalamount = new Random();
- int clamount = coalamount.nextInt(10);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.COAL, clamount + 1));
- } else {
- if(items9 >= 85 && items9 <= 89){
- Random horseamount = new Random();
- int hramount = horseamount.nextInt(2);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(417, hramount + 1));
- } else {
- if(items9 >= 90 && items9 <= 99){
- Random goldamount = new Random();
- int gdamount = goldamount.nextInt(5);
- Chest c = (Chest) locchest.getBlock().getState();
- c.getInventory().addItem(new ItemStack(Material.BREAD, gdamount + 1));
- }}}}}
- }
- }else {
- sender.sendMessage(ChatColor.DARK_RED + "You do not have permission to use that command!");
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement