Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Broadcast message when a player changes what level their on.

Comments in 'Plugin Development' started by ImagicalGamer, Feb 29, 2016.

  1. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    How can I broadcast a message to a specific level ex) world when a player joins that world. ex) "Player has joined the match!"
  2. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    PHP:
    Public function onLevelChange(EntityLevelChangeEvent $event) {
      
    $entity $event->getEntity();

      If(
    $entity instanceof pocketmine\Player) {
        Foreach(
    $event->getTarget()->getPlayers() as $p) {
          
    $p->sendMessage($entity->getName() . " has joined the match.");
        }
      }
    }
    applqpak likes this.
  3. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Just asking:
    What other entity apart from player changes levels?
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    All entities. Mobs, dropped items etc.
    applqpak likes this.
  5. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    Thanks!
  6. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    @Hotshot_9930 If I were to disable world saving after I had saved it restarting the server removes everything made after that save right? If so then what could I use instead of restarting the entire server and have that just affect the level? Would I need to re-load the level or what?
  7. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Yes. many threads have been made asking how to reset levels and got answers. If you search you will find one.
    applqpak likes this.
  8. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    Ok thanks, I didn't look at any threads for that.
  9. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    Maybe TimeCapsule Plugin... Although when it resets the map the server restarts
  10. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    I ment restoring the map to a previous version (skywars plug) I have everything done except the map reset.
  11. MichaelM04
    Offline

    MichaelM04 Active Member Plugin Developer

    Joined:
    Nov 12, 2015
    Posts:
    213
    Plugins:
    1
    Minecraft User:
    Michael
    I believe there's map reset somewhere in the code of this plugin maybe take a look

    https://github.com/ImagicalCorp/SpleefPE

    And there is a lot of threads about this I'll point them out if necessary
  12. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Advertising is not allowed here...
  13. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    When are they changing levels? WTF
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Every entity has the chance to change level. Including a plugin-defined entity.
    Hotshot_9930 likes this.
  15. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Lol, can i teleport FloatingText?
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    In PocketMine's understanding, FloatingTextParticle is a particle not an entity. You have to spawn an air item entity to teleport it.
    Hotshot_9930 likes this.
  17. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    The code specified players but even if not I have tested it and it doesn't broadcast a message when I shove my dog into a NetherPortal. xD

Share This Page

Advertisement