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

Freezing players

Comments in 'Plugin Development' started by PixelGuy75, Nov 25, 2014.

  1. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    Can you freeze players with the new api and if so how would you?
  2. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    PHP:
    function freezePlayersEntityMoveEvent $event) {
      if( 
    $event->getEntity instanceof Player ) {
        
    $event->setCancelled();
      }
    }
    xFlare likes this.
  3. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    Thanks! Also how would you unfreeze?
  4. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    Depends when you want it to be unfrozen. Add a conditional that suits your needs, and it should work.
  5. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    this event is already deprecated. use PlayerMoveEvent instead.
    Taha_The_Hacker likes this.
  6. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    I couldn't find that on the docs. Where is it located?
  7. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    i use http://docs.pocketmine.net

    I'm not sure but here:

    pocketmine\event\player\PlayerMoveEvent
  8. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    If I use PlayerMoveEvent would it still be onPlayerMove?


    I want to fix that annoying simple auth bug. ;)
  9. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
  10. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
  11. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
    when you make the event function, it looks something like this:

    PHP:
    public function someName(Event $eventVariable)
    The name of the function (someName) and the $eventVariable don't matter. What matters is the Event, so as long as you're using the same Event, the function name can be different and it would do the same thing.

    SimpleAuth bug?
  12. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    yes partially. but its buggy. it teleports player to void. thats why I made a temporary solution to that on my server.
  13. Tethered_
    Offline

    Tethered_ Active Member Plugin Developer

    Joined:
    Jun 24, 2014
    Posts:
    178
    Plugins:
    2
    Minecraft User:
    Frostbyte58
  14. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    I wish I knew that earlier xD

    Yes, SimpleAuth is really messed up right now, Sometimes /login and /register permissions fail & players can move without authentication.
    Tethered_ likes this.
  15. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    You just replaced the move event with the correct one, right?
  16. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    Tethered_ likes this.
  17. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    yes. but not with the same logic.
    xFlare likes this.
  18. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
  19. GlaciercreepsMC
    Offline

    GlaciercreepsMC Active Member Plugin Developer

    Joined:
    Jan 21, 2014
    Posts:
    91
    Plugins:
    1
    Minecraft User:
    GlaciercreepsMC
    Uh, hehe, just fyi, my plugin can do this. If you wanna look at the code I used, look here. Though, that code hasn't been used yet for my plugin (That's updated code, I haven't implemented it in my plugin, as I haven't got what I've been trying to do yet.)
  20. JoshV
    Offline

    JoshV New Member

    Joined:
    Oct 15, 2014
    Posts:
    5
    I had the same issue with simpleauth and fixed it by downgrading to simpleauth 1.4.

Share This Page

Advertisement