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

I need help making a Plugin

Comments in 'Plugin Development' started by SM11, Aug 10, 2015.

  1. SM11
    Offline

    SM11 Active Member

    Joined:
    Jun 21, 2015
    Posts:
    117
    Minecraft User:
    SM11
    Is it possible to make a plugin when on command it freezes a player and then on command it can unfreeze the whole all players in a certain world
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    Yes.
  3. SM11
    Offline

    SM11 Active Member

    Joined:
    Jun 21, 2015
    Posts:
    117
    Minecraft User:
    SM11
    Could you Help me
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    Sorry, i could give you a code but it will be really buggy cuz i dont have phone to test it on :(, so i will deny.
  5. SM11
    Offline

    SM11 Active Member

    Joined:
    Jun 21, 2015
    Posts:
    117
    Minecraft User:
    SM11
    I could Test It
  6. TigerHix
    Offline

    TigerHix Active Member

    Joined:
    May 11, 2015
    Posts:
    61
    Minecraft User:
    TigerHix
    Just store the location of a player when you want to freeze them:

    PHP:
    $locations[$player->getName()] = $player->getLocation();
    And then on player move:

    PHP:
    public function onPlayerMove(PlayerMoveEvent $event) {
        if (isset(
    $locations[$event->getPlayer()->getName()]) {
            
    $event->setTo($location[$event->getPlayer()->getName()]);
        }
    }
    When you need to unfreeze them, just remove them from the array:

    PHP:
    unset($locations[$player->getName()]);

Share This Page

Advertisement