Item bombs (Like Mineplex melon bomb)

Discussion in 'Plugin Development' started by zurg200, Nov 13, 2014.

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


    Hello again! I have been thinking about this forever and need to figure a way to fix this! So I'm trying to make item bombs.. When you throw a block (REDSTONE Or any other item) it throws the item and then blows up into tiny or for redstone- redstone dust goes everywhere.

    So I throw a redstone block (my eye location)
    Then the redstone block when it hits the ground it ten immediately breaks and spawns redstone dust like a death drop.

    Any help will be great..
  2. Offline


    schdueler checking if the Item is on the ground and if it is run a for loops that spawns a ton of items with random velocities.
  3. Offline


    You can try
    on player intect event launch a projectile, type this:

    1. event.getPlayer().launchProjectile(YOUR PROJECTILE type Snowball.class);
    2. player.playSound(player.getLocation(), Sound.WITHER_SHOOT, 10, 1);

    To do a player interact event:
    1. @EventHandler
    2. public class onPlayerInteractEvent(PlayerInteractEvent e){
    4. Player player = e.getPlayer();
    5. if (!(e.getAction == Action..RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK)) return;
    6. if (!(player.getItemInHand().getType() == Material.<YOUR MATERIAL>)) return;
    8. <YOUR CODE>
    10. }

    I hope this has helped
    I don't know a method to get snowball crash location
    Sorry for my english, I'm brazilian
  4. Offline


    Could you show me an example.. I am looking for something like Mineplex melon bomb.. I know how to do the rest..

    Thanks for the reply and I did do that and now I just need to make it like explode into another item and drop it around a certain area like a death drop.

    <Edit by mrCookieSlime: Merged Posts. Please dont double post. There is an Edit-Button right next to the Date.>
  5. Offline


    zurg200 Use a for loop to spawn a bunch of items and give them random velocities using the Random class. We aren't going to spoon feed you.
    acer5999 likes this.
  6. Offline


    Like this (it won't let me use the code button on my phone)

    Item randomItem = spawnplek.getWorld().dropItem(spawnplek, specialItems.get(rand.nextInt(specialItems.size())));
    randomItem.setVelocity(new Vector(0,0,0));;
  7. Offline


    1. Player p = event.getPlayer();
    2. Item droppedItem = p.getLocation().getWorld().dropItem(p.getEyeLocation.subtract(0, 0.5, 0), new ItemStack(Material.MELON));
    3. droppedItem.setVelocity(p.getEyeLocation().getDirection().normalize().multiply(2));
    4. p.sendMessage("§b§lYou threw a §c§lMelon");

    There, enjoy
  8. Offline


    Hmm.. can you do this when someone dies? But then make it dissapear after the items hit the ground?
  9. Offline


    Use schedulers that constantly check if the item is on the ground.
  10. Offline


    Well, I've been looking for the plugin that they have on MineTime (IP: If you play their SG they have items explode out of a player when they die. Although, players are unable to pick up the items.
Thread Status:
Not open for further replies.

Share This Page