Player Popper

Discussion in 'Archived: Plugin Requests' started by JordyPwner, May 26, 2014.

  1. Offline

    mactown21

    timtower so

    if(((Projectile) event).getShooter()instanceof Player && event.getEntity() instanceof Arrow)

    I have used this in one of my plugins and it worked fine
     
  2. Offline

    timtower Administrator Administrator Moderator

    mactown21 ((Projectile)event.getEntity()).getShooter() instanceof Player
     
  3. Offline

    mactown21

    timtower Correct?

    Code:
            if(((Projectile) event.getEntity()).getShooter() instanceof Player && event.getDamager()instanceof Arrow )
            {
                final Player p = (Player)event.getDamager();
                final Player a = (Player)event.getEntity();
     
  4. Offline

    timtower Administrator Administrator Moderator

    You are still checking the damager while that will keep throwing errors if you cast it to a player
     
  5. Offline

    mactown21

    timtower ok so i will just leave it as this
    Code:
    if(((Projectile) event.getEntity()).getShooter() instanceof Player)
    Im just confused because ive used this on my old plugin and it worked fine, no errors! Final Results

    Code:
            if(((Projectile) event.getEntity()).getShooter() instanceof Player)
            {
                final Player p = (Player)((Projectile) event).getShooter();
                final Player a = (Player)event.getEntity();
    Thanks
     
  6. Offline

    timtower Administrator Administrator Moderator

    mactown21 Still same mistake
    Code:java
    1. @EventHandler
    2. public void onHit(EntityDamageByEntityEvent event){
    3. if(!(event.getEntity() instanceof Player))return;
    4. Player a = (Player)event.getEntity();
    5. Entity damager = event.getDamager();
    6. Player p = null;
    7. if(damager instanceof Player){
    8. p = (Player)damager;
    9. }else if(damager instanceof Projectile){
    10. p = (Player)((Projectile)damager).getShooter();
    11. }else{
    12. return;
    13. }
     
  7. Offline

    mactown21

    timtower That dosent work neither with the if((a.getEntity()).equalsIgnoreCase((p.damager())

    a.hidePlayer(p)

    and also, the timer that ive added below will not work they way you have added it. Can you just remake the whole entire onHit void, with timer to unhide player because this is confusing me. and i have alot of studying to do at home, (not with java) so im kindof busy. Thanks
     
  8. Offline

    timtower Administrator Administrator Moderator

    mactown21 Comparing an entity with a string? Not very logical.
    And I won't make that. I gave you the attacked player and the attacker. You can use a and p, both are players.
     
  9. Offline

    mactown21

  10. Offline

    Onlineids

    [quote uid=90955271 name="JordyPwner" post=2528850]mactown21 Cant test it now cause i have to sleep[/quote]

    Try this: <Edit by Moderator: Redacted mediafire url>
    (Untested)
     
    Last edited by a moderator: Nov 2, 2016
  11. Offline

    JordyPwner

    Onlineids
    mactown21

    Its working only what i want that if possible
    when you shoot you always get a arrow effect in particles.png what i want is more effect then just 1 trail i want like 3 trails in a triangle or something

    and the player who i shoot still gets damage. i dont want that he get damage
     
    mactown21 likes this.
  12. Offline

    Onlineids

    If you want things in the plugin.... you should put them in the PLUGIN request so we aren't waiting for you to add more crap that you could've just mentioned in the original post...
     
    mactown21 likes this.
  13. Offline

    JordyPwner

    Onlineids the plugin isnt even working..
     
  14. Offline

    Onlineids

    Yea and doubt he is gonna fix it when your throwing new features at him
     
    mactown21 likes this.
  15. Offline

    yoft

    Here: PartyPopper.jar

    There are a lot of options in the config, if you're not sure on anything, feel free to ask :)
     
    mactown21 likes this.

Share This Page