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

    zurg200

    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.

    Confused?
    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

    Skionz

    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

    thewalkingplay

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

    Code:java
    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:
    Code:java
    1. @EventHandler
    2. public class onPlayerInteractEvent(PlayerInteractEvent e){
    3.  
    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;
    7.  
    8. <YOUR CODE>
    9.  
    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

    zurg200

    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

    Skionz

    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

    zurg200

    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

    CentrumGuy

    Code:java
    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

    fujiboy4

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

    Skionz

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

    fujiboy4

    Well, I've been looking for the plugin that they have on MineTime (IP: minetime.com). 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