LegendaryAxe

Discussion in 'Plugin Requests' started by Ilikebookies, Apr 8, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Ilikebookies

    Plugin category: Pvp

    Suggested name: PyroAxe

    What I want: Hey hardworkers! I was wondering if you guys can make a really cool plugin. As you know lots of these people have been requesting this.

    Pyro Axe:
    Name: 'Pyro Axe'
    Lore: 'I Come From The Iron Hills' in dark red.
    Armor Type: Axe (any axe)
    Effect: I got this from a precoded plugin '
    entity.getWorld().playEffect(entity.getLocation(), Effect.ZOMBIE_DESTROY_DOOR, 10);
    entity.getWorld().playSound(entity.getLocation(), Sound.ANVIL_LAND, 1f, 0.001f);
    '
    Use: When player that is on fire is hit with the axe it'll make a sound like above. The lore will make this special axe work. You can rename it what ever and the sound and damage will still work. You can make your own damage instead of the axe being 3x times stronger. I want one where you can edit how strong it can be. You can hit people that's not in pvp and it will make the sound still even though you're not in pvp. :D


    Ideas for commands: Just one command.
    /pyroaxe

    Ideas for permissions:
    - pyroaxe.* - all commands
    - pyroaxe.item- can spawn the item.

    Only the OPS can spawn the item or have the -pyroaxe.item permission.

    When I'd like it by: Anytime

    Thanks In Advance.

    Hope you guys make this special plugin for me. Can be public if you guys like because it's all your hardwork. Thanks again and please make this plugin. :D

    1.8 and 1.9 btw :D Compatible with Spigot too :D Also it's so it goes to kits.
     
  2. Offline

    cluter123

    I'll do this after I finish my league game. ~one hr estimate.
     
  3. Offline

    Ilikebookies

    Thanks Bro. Take all the time you need brotherrrr
     
  4. Offline

    cluter123

    Going to sleep for the day. Everything is done, just some NPE's I gotta figure out. It'll be done by tomorrow.
     
  5. Offline

    Ilikebookies

    Sounds Good.

    Btw tell me if you're confused on somethings. I wasn't very specific.
     
    Last edited by a moderator: Apr 8, 2016
  6. Offline

    cluter123

    Busy with another request. If anyone wants to fix the errors, go right ahead (Leaving it to another dev to finish it)

    Code:
    package me.cluter.pyroaxe;
    
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.List;
    
    import org.bukkit.ChatColor;
    import org.bukkit.Effect;
    import org.bukkit.Material;
    import org.bukkit.Sound;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.enchantments.Enchantment;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.EntityDamageByEntityEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin implements Listener {
        public void onEnable() {
            getServer().getPluginManager().registerEvents(this, this);
            saveDefaultConfig();
        }
       
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            if(label.equalsIgnoreCase("pyroaxe")) {
                if(!(sender instanceof Player)) {
                    sender.sendMessage("Only players may use this command.");
                }
                Player p = (Player)sender;
                if(!p.hasPermission("pyroaxe.admin")) {
                    p.sendMessage(ChatColor.RED + "You do not have permission to do this.");
                    return false;
                }
                ItemStack axe = new ItemStack(Material.DIAMOND_AXE, 1);
                ItemMeta meta = axe.getItemMeta();
                List<String> lore = new ArrayList<String>();
                lore.add(ChatColor.translateAlternateColorCodes('&', getConfig().getString("lore")));
                meta.setLore(lore);
                meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', getConfig().getString("name")));
                meta.addEnchant(Enchantment.FIRE_ASPECT, 1, true);
                axe.setItemMeta(meta);
                if(args[0].equalsIgnoreCase("give")) {
                    if(args[1] == null ) {
                        p.getInventory().addItem(axe);
                        p.sendMessage(ChatColor.RED + "A PyroAxe has been added to your inventory.");
                        return true;
                    }
                    @SuppressWarnings("deprecation")
                    Player tar = getServer().getPlayer(args[1]);
                    if(tar != null) {
                    tar.getInventory().addItem(axe);
                    p.sendMessage(ChatColor.RED + "A PyroAxe has been added to " + args[1] + "'s inventory.");
                    return true;
                    }
                    p.sendMessage("The player could not be found. Usage: /pyroaxe give <player>");
                    return true;
                }
                p.sendMessage(ChatColor.RED + "Usage: </pyroaxe give (player)>");
               
            }
            return false;
        }
    
        @EventHandler
        public void onDamage(EntityDamageByEntityEvent e) {
            if (!(e.getDamager() instanceof Player))
                return;
            Player attacker = (Player) e.getDamager();
            if(!attacker.hasPermission("pyroaxe.use")) return;
            if (attacker.getItemInHand().getItemMeta().getLore().contains(ChatColor.translateAlternateColorCodes('&', getConfig().getString("lore")))) {
                    attacker.getWorld().playEffect(attacker.getLocation(), Effect.ZOMBIE_DESTROY_DOOR, 10);
                    attacker.getWorld().playSound(attacker.getLocation(), Sound.ANVIL_LAND, 1f, 0.001f);
                    e.setDamage(getConfig().getDouble("damage"));
            }
    
        }
    }
    
     
Thread Status:
Not open for further replies.

Share This Page