1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how to have the list of Slapper in a world

Discussion in 'Plugin Help' started by TeraCube, Sep 22, 2018.

  1. TeraCube

    TeraCube Zombie

    Messages:
    262
    GitHub:
    teracube
    I use Slapper plugin (last Poggit release)
    https://poggit.pmmp.io/p/SLAPPER

    could you tell me how to have slapper list and coordinate on a world
    in the plugin_data/Slapper i found no file

    thanks
    sorry for my bad english
     
  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Slappers are saved as real entities in your world save. You cannot simply get a list of slappers without iterating over entities in all chunks.
     
  3. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    foreach all the entities of the world as entity
    check if entity is an instance of SlapperEntity (I am not 100% sure if the entity is named like that)
    if so, send yourself a message with the entity ID and the xyz coordinates.

    To get the count, $count = 0;
    foreach the entities and check if it is an instance of that slapper entity. If so do $count++;
    Then send a message to you like "Slapper count: ".$count
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Why do you want a list of slappers?
     
  5. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    foreach all entities of the world -- It's not that simple. You would have to load all chunks for that to work.
     
    Muqsit likes this.
  6. Aericio

    Aericio Slime

    Messages:
    99
    GitHub:
    aericio
    TeraCube likes this.
  7. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Do you? My fault. So this is why my code did not work...
     
  8. TeraCube

    TeraCube Zombie

    Messages:
    262
    GitHub:
    teracube
    on a big map it's more easy to have a list and coordinates when i need to delete slappers

    sorry for my bad english
     
  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.