Filled [Request] ThrowableItem

Discussion in 'Archived: Plugin Requests' started by DerpyMan, Feb 14, 2014.

  1. Offline


    All I want is for a plugin that can throw a clayball. I have tried to code it but I had problems with it. It didn't work :(, As you can see
    What I want in the plugin
    -Able to throw a Clayball
    - When a player hits u multiple times, you drop the clayball
    -Its for basketball :D
    1. import java.awt.Desktop.Action;
    3. import net.minecraft.server.v1_7_R1.Item;
    4. import net.minecraft.server.v1_7_R1.ItemStack;
    5. import net.minecraft.server.v1_7_R1.World;
    7. import org.bukkit.Material;
    8. import org.bukkit.entity.Entity;
    9. import org.bukkit.entity.Player;
    10. import org.bukkit.event.EventHandler;
    11. import org.bukkit.event.player.PlayerInteractEvent;
    12. import;
    13. import org.bukkit.scheduler.BukkitRunnable;
    15. public class Main extends JavaPluginLoader
    17. @EventHandler
    18. public void clayballBasketball(PlayerInteractEvent event) {
    19. Player player = event.getPlayer();
    20. org.bukkit.World world = player.getWorld();
    21. if (player.getItemInHand().getType() == Material.CLAY_BALL) {
    22. if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_AIR) {
    23. final Item basketball = world.dropItem(player.getEyeLocation(), new ItemStack());
    24. Entity clayball;
    25. clayball.setVelocity(player.getEyeLocation().getDirection());
    26. new BukkitRunnable(){package me.AceAwesome13.Basketball;
    28. public void run(){
    29. );
    30. }
    31. }.runTaskLater(plugin, 100L);
    32. }
    33. }
    34. }
    35. }

    Thank you for anyone who view this post :D
  2. Offline


    Are you requesting a plugin because code didnt work or are you asking for how to fix your code?
  3. Offline


  4. Offline


    DerpyMan It would be much easier if you used a snowball.
  5. Offline


    Since this is in the "Plugin Requests", I'm assuming that he/she's requesting for someone to take on the task of programming this as his/her attempt was unsuccessful... but yes, you are right Necrodoom, it is very vague :/
  6. Offline


    RishkDev If I used a snowball, players can't not pick it up and it would not go into a hopper if you threw it

    [Edit] Unless if you are telling me to use the snowball instead of the clayball

    Necrodoom Sorry I didn't made it clear. I am requesting a plugin, but you are more than welcome to help me fix it :D

Share This Page