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

How To Make An Invible barrier

Comments in 'Plugin Development' started by TheMadGamer, Aug 18, 2015.

  1. TheMadGamer
    Offline

    TheMadGamer New Member

    Joined:
    Aug 18, 2015
    Posts:
    6
    Minecraft User:
    TheMadGamer
    Ok I was wondering how could I make an invisible barrier but it has to let them tp away

    Bassicly for players to not stand in front of the join mini games signs
    i hope you understood me

    Sorry for my bad English
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Invisible bedrock. or if you want it as plugin look below
    PHP:
    public function onMove(PlayerMoveEvent $event){
    if(
    $this->isInside($event->getPlayer()->getPosition(), $pos1$pos2)){
    $event->getPlayer()->teleport($event->getFrom());
    // Send message if you want to inform players why they're knocked back
    }
    }

    public function 
    isInside(Position $ppPosition $p1Position $p2){
    return (
    $pp->getX() >= $p1->getX() && $pp->getX() <= $p2->getX() && $pp->getY() >= $p2->getY() && $pp->getY() <= $p1->getY() && $pp->getZ() >= $p1->getZ() && $pp->getZ() <= $p2->getZ() && $pp->getLevel()->getName() === $p1->getLevel()->getName(), $pp->getLevel()->getName() === $p2->getLevel()->getName());
    }
    Andrey Nazarchuk likes this.
  3. GetAway
    Offline

    GetAway New Member

    Joined:
    Mar 26, 2015
    Posts:
    26
    Minecraft User:
    GetAway
    ID 95. It does make blocks around it sort of weird looking. I think InstantPvP uses something with chests. But Invis Bedrock is the easiest.
  4. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    you could add knockback instead, that way they aren't "glitched" back when the servers a bit laggy
    Last edited: Aug 22, 2015
    Ake likes this.
  5. LoveToBeDev
    Offline

    LoveToBeDev Active Member

    Joined:
    Aug 19, 2015
    Posts:
    55
    Minecraft User:
    LoveToBeDev
    Yeah, you can hear the idea of CrazedMiner, actually, create a kind of like block reaction, get the 95 block id, then establish a contact reaction :D
    Ake and CrazedMiner like this.

Share This Page

Advertisement