How could this be made?

Discussion in 'Plugin Development' started by Captain Dory, Apr 11, 2014.

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

    Captain Dory

    Hi there bukkit,
    What i'm basically trying to do is:
    A player shoots a snowball, it cancels the event and fires an ender pearl in the direction they're facing
    When the enderpearl impacts it explodes
    Chat says "<shooter> killed <victim> with rocket!"

    I've gotten everything except finding out if a player died by it. I'm thinking i'll have to do something with hashmaps and uuids.
    Opinions?

    I've done the exploding part, I need help with getting the players that died from the explosion caused by the players ender pearl

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  2. Offline

    Beasty

    You have to make Integers for Example

    Code:
    Player victim = (Player)e.getEntity();
    Player damager = (Player)e.getDamager(); 
    and Then you have to configure it and You do.

    Code:
    p.sendMessage(ChatColor.WHITE + damager + " has killed" + victim + " with rocket!");
    If you need any help, Shoot my a PM and I will be glad to help!
     
  3. Offline

    Captain Dory

    What i'm actually looking for is this (I probably misinterpreted what I needed before):
    If you shoot a snowball, the enderpearl explodes and it explodes on impact(done)
    If a player dies by that explosion, I need to get who shot the snowball that made the explosion, and all the players that died from the explosion.
     
  4. Offline

    Beasty

    Code:java
    1. victim.isDead();
    2. this.getServer().broadcastMessage(ChatColor.GOLD + damager + " has killed" + victim + " by rocket!");


    You put that, and It should Broadcast to the server ;)
     
  5. Offline

    amhokies

    What integers are you even talking about?
     
  6. Offline

    Xyplo

    This is what I'd do!
    Code:java
    1.  
    2. @EventHandler
    3. public void Death(PlayerDeathEvent e){
    4. Player p = e.getEntity();
    5. Player k = p.getKiller();
    6. e.setDeathMessage("");
    7. bukkit.broadcastMessage("" + p.getKiller() + " killed " e.getEntity() " with a rocket!");
    8. }
     
  7. Offline

    Captain Dory

    My god guys- I know how to make death messages. Read this post:
     
  8. Offline

    leet4044

    He wants a custom death message for just when they die by the explosion caused by the enderpearl or whatever.
     
  9. Offline

    Niknea

    Captain Dory Listen to the EntityDamageByEntity event, check if the damager is a ender pearl, if it is, get the shooter.
     
  10. Offline

    Captain Dory

    The damager is an explosion caused by the enderpearl- I need to know who fired the enderpearl.
     
  11. Offline

    GotRice

    Captain Dory Change the explosion to be a fake explosion (No Damage), get entities within the radius check and damage them appropriately with the player as the damager.
     
  12. Offline

    Captain Dory

    That's a pretty smart idea actually. Thanks! I'll test this when I can. Also, what would appropriate damage values be?
     
Thread Status:
Not open for further replies.

Share This Page