update slapper player status

Discussion in 'Development' started by ToddyWars, Feb 11, 2019.

  1. ToddyWars

    ToddyWars Spider Jockey

    Messages:
    30
    GitHub:
    ToddyWars
    I addes this in slapper
    PHP:
    $lobby $this->getServer()->getLevelByName("world");
    $lobbyp count($lobby->getPlayers());
    $name str_replace("{color}""ยง"str_replace("{line}""\n",
    str_replace("{lobby}"$lobbyptrim(implode(" "$args)))));
    when I put {lobby} it shows how many players have in this world "0" but if I enter the world "0" does not change, how do I update every time someone enters this world?
     
  2. wolfdale

    wolfdale Zombie

    Messages:
    258
    You can either use EntityLevelChangeEvent or a task
     
    ToddyWars likes this.
  3. ToddyWars

    ToddyWars Spider Jockey

    Messages:
    30
    GitHub:
    ToddyWars
    I tried, but I can not get the Entity, not the error but also not the results.
     
  4. Gianluxx

    Gianluxx Silverfish

    Messages:
    18
    GitHub:
    Gianluxx
    Slapper is not intended for this use. Use a FloatingText that updates each ticks/ onLevelChange.
     
  5. ToddyWars

    ToddyWars Spider Jockey

    Messages:
    30
    GitHub:
    ToddyWars
    So what do I have to add and where?
     
  6. Gianluxx

    Gianluxx Silverfish

    Messages:
    18
    GitHub:
    Gianluxx
    Remove your code from Slapper plugin.
    Create a new Plugin that spawns a FloatingText and saves his ID. Then each Ticks/LevelChange, check Number in Level and if different, update the ID Entity text
     
    corytortoise likes this.
  7. ToddyWars

    ToddyWars Spider Jockey

    Messages:
    30
    GitHub:
    ToddyWars
    Could not use the aFloatingText itself?
     
  8. Gianluxx

    Gianluxx Silverfish

    Messages:
    18
    GitHub:
    Gianluxx
    There are already made plugins, you can use them
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.