
Originally Posted by
C++Coding
Look at how other enchantments are added.Profit.
Yea I looked but I dont know what smite is....
---------- Post added at 08:07 PM ---------- Previous post was at 07:44 PM ----------
This is what I did
: decompile then save source, open source with eclipse and this is what shows up
/* */ package GodSword;
/* */
/* */ import java.util.logging.Logger;
/* */ import org.bukkit.ChatColor;
/* */ import org.bukkit.Material;
/* */ import org.bukkit.Server;
/* */ import org.bukki*****mmand.Command;
/* */ import org.bukki*****mmand.CommandSender;
/* */ import org.bukkit.enchantments.Enchantment;
/* */ import org.bukkit.entity.Player;
/* */ import org.bukkit.inventory.ItemStack;
/* */ import org.bukkit.inventory.PlayerInventory;
/* */ import org.bukkit.plugin.java.JavaPlugin;
/* */
/* */ public class GodSword extends JavaPlugin
/* */ {
/* */ public void onEnable()
/* */ {
/* 17 */ getLogger().info("GodSword is starting up...");
/* */ }
/* */
/* */ public void onDisable()
/* */ {
/* 22 */ getLogger().info("GodSword is shutting down...");
/* */ }
/* */
/* */ public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
/* 26 */ if (label.equalsIgnoreCase("gsword")) {
/* 27 */ if (args.length == 0) {
/* 28 */ if ((sender instanceof Player)) {
/* 29 */ Player target = (Player)sender;
/* 30 */ ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
/* 31 */ PlayerInventory inv = target.getInventory();
/* 32 */ sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 7);
/* 33 */ sword.addUnsafeEnchantment(Enchantment.FIRE_ASPECT , 7);
/* 34 */ sword.addUnsafeEnchantment(Enchantment.DURABILITY, 7);
/* 35 */ sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 7);
/* 36 */ inv.addItem(new ItemStack[] { sword });
/* */ }
/* 38 */ if (!(sender instanceof Player))
/* 39 */ sender.sendMessage("This command can only be run by a player!");
/* */ }
/* 41 */ else if (args.length == 1) {
/* 42 */ Player target = getServer().getPlayer(args[0]);
/* 43 */ if ((sender instanceof Player)) {
/* */ try {
/* 45 */ ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
/* 46 */ PlayerInventory inv = target.getInventory();
/* 47 */ sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 7);
/* 48 */ sword.addUnsafeEnchantment(Enchantment.FIRE_ASPECT , 7);
/* 49 */ sword.addUnsafeEnchantment(Enchantment.DURABILITY, 7);
/* 50 */ sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 7);
/* 51 */ inv.addItem(new ItemStack[] { sword });
/* */ } catch (Exception e) {
/* 53 */ target.sendMessage(ChatColor.DARK_RED + target.getDisplayName().toString() + " is not online!");
/* */ }
/* */ }
/* 56 */ if (!(sender instanceof Player)) {
/* */ try {
/* 58 */ ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
/* 59 */ PlayerInventory inv = target.getInventory();
/* 60 */ sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 7);
/* 61 */ sword.addUnsafeEnchantment(Enchantment.FIRE_ASPECT , 7);
/* 62 */ sword.addUnsafeEnchantment(Enchantment.DURABILITY, 7);
/* 63 */ sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 7);
/* 64 */ inv.addItem(new ItemStack[] { sword });
/* */ } catch (Exception e) {
/* 66 */ target.sendMessage(ChatColor.DARK_RED + target.getDisplayName().toString() + " is not online!");
/* */ }
/* */ }
/* */ }
/* */ }