Entity chunk

Discussion in 'Plugin Development' started by Rufflez, Aug 7, 2014.

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

    Rufflez

    Hey i'm making a plugin which teleports a zombie to the player when it spawns but my console keeps being spammed is there any way to stop this?

    Code:java
    1. @EventHandler
    2. public void onPlayerMoveEvent(CreatureSpawnEvent e) {
    3. if (e.getEntity() instanceof Zombie) {
    4. for (Player p : Bukkit.getOnlinePlayers())
    5. {
    6. e.getEntity().teleport(p);
    7. e.getEntity().addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100000, 0));
    8. }
    9. }
    10. }
    11. }
    12.  


    Console image: http://gyazo.com/61bda45fc31b480d00d8cd3250f2d4f9
    [​IMG]
     
  2. Offline

    DannyDog

    Rufflez
    You're spawning 1 zombie, getting all the players online then teleporting that zombie to all the players?
    w0t
     
  3. Offline

    Rufflez

    How would i make it so the zombie teleports to the player if the players is in a 10 block radius of the zombie?
     
Thread Status:
Not open for further replies.

Share This Page