This plugin gives you cheaty armor and weapons and other goodies.
To install this plugin, copy the plugin JAR file to your server's plugins folder.
I currently run a Rainbow server but I want greater functionality than the Rainbow API provides, so I've been learning Spigot. This is one of several silly plugins I've written to that end.
Code (Text):
package FredashaySpigotGod;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
public class MyPlugin extends JavaPlugin implements Listener, CommandExecutor {
private static Logger logger = null;
private static PluginDescriptionFile pdfFile = null;
@Override
public void onEnable() {
logger = Logger.getLogger("Minecraft");
pdfFile = getDescription();
getServer().getPluginManager().registerEvents(this,this);
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (label.equalsIgnoreCase("god")) {
if (!(sender instanceof Player)) {
sender.sendMessage("[" + pdfFile.getName() + "] This command can only be issued by a player in the game. ");
return (false);
}
Player player = (Player) sender;
if (player.isOp()) {
logger.info("[" + pdfFile.getName() + "] Player '" + player.getName() + "' got some God stuff. ");
player.sendMessage("<SERVER> Cheater! ");
Inventory inv = Bukkit.createInventory(null, 27, "God Inventory");
ItemStack mySword = new ItemStack(Material.DIAMOND_SWORD);
mySword.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 2);
mySword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 5);
mySword.addUnsafeEnchantment(Enchantment.MENDING, 3);
inv.addItem(mySword);
ItemStack myHelm = new ItemStack(Material.DIAMOND_HELMET);
myHelm.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
myHelm.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, 4);
myHelm.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
myHelm.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 4);
myHelm.addUnsafeEnchantment(Enchantment.OXYGEN, 3);
myHelm.addUnsafeEnchantment(Enchantment.WATER_WORKER, 1);
inv.addItem(myHelm);
ItemStack myShirt = new ItemStack(Material.DIAMOND_CHESTPLATE);
myShirt.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
myShirt.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, 4);
myShirt.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
myShirt.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 4);
inv.addItem(myShirt);
ItemStack myPants = new ItemStack(Material.DIAMOND_LEGGINGS);
myPants.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
myPants.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, 4);
myPants.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
myPants.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 4);
myPants.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, 4);
inv.addItem(myPants);
ItemStack myBoots = new ItemStack(Material.DIAMOND_BOOTS);
myBoots.addUnsafeEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 4);
myBoots.addUnsafeEnchantment(Enchantment.PROTECTION_FIRE, 4);
myBoots.addUnsafeEnchantment(Enchantment.PROTECTION_EXPLOSIONS, 4);
myBoots.addUnsafeEnchantment(Enchantment.PROTECTION_PROJECTILE, 4);
myBoots.addUnsafeEnchantment(Enchantment.PROTECTION_FALL, 4);
myBoots.addUnsafeEnchantment(Enchantment.DEPTH_STRIDER, 3);
inv.addItem(myBoots);
ItemStack myBow = new ItemStack(Material.BOW);
myBow.addUnsafeEnchantment(Enchantment.ARROW_INFINITE, 1);
myBow.addUnsafeEnchantment(Enchantment.ARROW_FIRE, 1);
myBow.addUnsafeEnchantment(Enchantment.KNOCKBACK, 2);
myBow.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 5);
myBow.addUnsafeEnchantment(Enchantment.MENDING, 3);
inv.addItem(myBow);
ItemStack myArrows = new ItemStack(Material.ARROW, 64);
inv.addItem(myArrows);
ItemStack myPick1 = new ItemStack(Material.DIAMOND_PICKAXE);
myPick1.addUnsafeEnchantment(Enchantment.LOOT_BONUS_BLOCKS, 3);
myPick1.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 5);
myPick1.addUnsafeEnchantment(Enchantment.MENDING, 3);
myPick1.addUnsafeEnchantment(Enchantment.SWEEPING_EDGE, 5);
myPick1.addUnsafeEnchantment(Enchantment.DIG_SPEED, 5);
inv.addItem(myPick1);
ItemStack myPick2 = new ItemStack(Material.DIAMOND_PICKAXE);
myPick2.addUnsafeEnchantment(Enchantment.SILK_TOUCH, 1);
myPick2.addUnsafeEnchantment(Enchantment.MENDING, 3);
myPick2.addUnsafeEnchantment(Enchantment.SWEEPING_EDGE, 5);
myPick2.addUnsafeEnchantment(Enchantment.DIG_SPEED, 5);
inv.addItem(myPick2);
ItemStack myShovel = new ItemStack(Material.DIAMOND_SPADE);
myShovel.addUnsafeEnchantment(Enchantment.LOOT_BONUS_BLOCKS, 3);
myShovel.addUnsafeEnchantment(Enchantment.MENDING, 3);
myShovel.addUnsafeEnchantment(Enchantment.SWEEPING_EDGE, 5);
myShovel.addUnsafeEnchantment(Enchantment.DIG_SPEED, 5);
inv.addItem(myShovel);
ItemStack myAxe = new ItemStack(Material.DIAMOND_AXE);
myAxe.addUnsafeEnchantment(Enchantment.LOOT_BONUS_BLOCKS, 3);
myAxe.addUnsafeEnchantment(Enchantment.MENDING, 3);
myAxe.addUnsafeEnchantment(Enchantment.SWEEPING_EDGE, 5);
myAxe.addUnsafeEnchantment(Enchantment.DIG_SPEED, 5);
inv.addItem(myAxe);
ItemStack myHoe = new ItemStack(Material.DIAMOND_HOE);
myHoe.addUnsafeEnchantment(Enchantment.MENDING, 3);
inv.addItem(myHoe);
ItemStack myScissors = new ItemStack(Material.SHEARS);
myScissors.addUnsafeEnchantment(Enchantment.SILK_TOUCH, 1);
myScissors.addUnsafeEnchantment(Enchantment.MENDING, 3);
myScissors.addUnsafeEnchantment(Enchantment.SWEEPING_EDGE, 5);
inv.addItem(myScissors);
ItemStack myRod = new ItemStack(Material.FISHING_ROD);
myRod.addUnsafeEnchantment(Enchantment.MENDING, 3);
myRod.addUnsafeEnchantment(Enchantment.LUCK, 3);
myRod.addUnsafeEnchantment(Enchantment.LURE, 3);
inv.addItem(myRod);
ItemStack myWings = new ItemStack(Material.ELYTRA);
myWings.addUnsafeEnchantment(Enchantment.MENDING, 3);
inv.addItem(myWings);
ItemStack mySteak = new ItemStack(Material.COOKED_BEEF, 64);
inv.addItem(mySteak);
ItemStack myBottle = new ItemStack(Material.EXP_BOTTLE, 64);
inv.addItem(myBottle);
ItemStack myBlock = new ItemStack(Material.COMMAND);
inv.addItem(myBlock);
ItemStack myStructure = new ItemStack(Material.STRUCTURE_BLOCK);
inv.addItem(myStructure);
ItemStack mySpawner = new ItemStack(Material.MOB_SPAWNER);
inv.addItem(mySpawner);
player.openInventory(inv);
return (true);
}
return (false);
}
return (false);
}
public void doNothing() { }
}