Reverser kit! (Based off of switcher)

Discussion in 'Plugin Development' started by TCO_007, Apr 12, 2014.

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

    TCO_007

    I am making a kit called Reverser. Its a remake of the kit switcher. For what ever reason, this code is not working and I am confused why it wont. It is probably a real simple fix but I need a 2nd pair of eyes to help me.
    (Reverser - throw a snowball at your enemy to switch places!)
    Code:java
    1. public void onReverser(EntityDamageByEntityEvent e){
    2.  
    3. if (e.getEntity() instanceof Player && e.getDamager() instanceof Snowball){
    4.  
    5. Player p = (Player) e.getEntity();
    6. Snowball s = (Snowball) e.getDamager();
    7. Player shooter = (Player) s.getShooter();
    8. Location ShooterLoc = (Location) shooter.getLocation();
    9. if (!plugin.Reverser.contains(shooter.getName())){
    10. if (shooter.getItemInHand() == new ItemStack(Material.SNOW_BALL)){
    11. p.teleport((org.bukkit.Location) ShooterLoc);
    12. shooter.teleport(p);
    13. }
    14. }
    15. }
    16. }
    17. }
    18.  
     
  2. Offline

    Regablith

    Code:java
    1. if (!plugin.Reverser.contains(shooter.getName())){
    2.  

    You are checking if it doesn't, and if it doesn't, then it switches their locations.
     
Thread Status:
Not open for further replies.

Share This Page