Fire Ball 2015-12-10

Shote fireballs with a stick

  1. eddie
    INFO
    -----------------------------------------------------------------------------------------------------
    Shoot fireballs when right clicking a stick
    -----------------------------------------------------------------------------------------------------
    PLEASE READ
    It's for 1.8.
    If you want to use the plugin to add to your own plugin feel free :)
    I don't mind as its a simple plugin but it's cool
    -----------------------------------------------------------------------------------------------------
    Please leave a nice review and thanks for downloading :)

Recent Updates

  1. FIX

Recent Reviews

  1. Nonopichy
    Nonopichy
    5/5,
    Version: 2015-12-10
    Plugin does what should be very good, I ended up modifying it and making it better in my opinion, I help myself a lot, I'm a beginner and I'm starting to work with plugins.

    Well i'm not american so bad english.

    (I don't know if you can expose the code, but as you said you can change it)
    Here what i did;

    package me.Goldiedog123;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.entity.SmallFireball;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin implements Listener {
    public void onEnable() {
    Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "Plugin ativo!");
    getServer().getPluginManager().registerEvents(this, (Plugin)this);
    }

    @EventHandler
    public void interact(PlayerInteractEvent event) {
    Action eventAction = event.getAction();
    Player player = event.getPlayer();
    if ((eventAction == Action.RIGHT_CLICK_AIR || eventAction == Action.RIGHT_CLICK_BLOCK) &&
    player.getItemInHand().getType().equals(Material.FIREBALL)){
    ((SmallFireball)player.launchProjectile(SmallFireball.class)).setVelocity(player.getLocation().getDirection().multiply(0.5D));
    player.getInventory (). removeItem(new ItemStack[] {
    new ItemStack(Material.FIREBALL, 1)});
    }
    }
    }

    ============

    Sou brasileio
    1. eddie
      Author's Response
      yew yew, if you want to stop any errors in console when learning to code, first check if the item is null and return if its null then do code so it wont spam your console :)