Quick Question

Discussion in 'Plugin Development' started by XvBaseballkidvX, Oct 19, 2013.

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

    XvBaseballkidvX

    Hello everyone!

    I just have a really quick question:
    CODE:
    Code:java
    1. @EventHandler
    2. public void onPlayerMove(PlayerMoveEvent event){
    3. Player player = event.getPlayer();
    4. if(player.getInventory().getBoots().getItemMeta() == null) return;
    5. if(player.getInventory().getBoots().getItemMeta().equals(OpCrateItem.speedboots)){
    6. player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 100, 2));
    7. }
    8. }


    Would that cause lag if there were, lets say ,100 people on a server?

    Thank you for reading!
    All help is much appreciated!

    EDIT: Fixed Typo :p
     
  2. Offline

    adam753

    Probably, yes. It would be more ideal to keep a list of all players who have the boots equipped (via InventoryClickEvent) and give them the potion effect in a server-wide loop.
     
    XvBaseballkidvX likes this.
  3. Offline

    XvBaseballkidvX

Thread Status:
Not open for further replies.

Share This Page