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

Solved Spectator mode help

Comments in 'Plugin Development' started by Creeperface, Sep 4, 2015.

  1. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    hi i want to make spectator mode in my plugin. I despawn all cpectators to another players but players cant place block if there is a player in spectator mode. How can i fix this?
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    They cant brake if player in spectator mod is in front of the block?
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Non of the big server networks has been fixed or worried about this. Try to kick spectators back if he is too close to normal player
  5. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    no i dont want to use MoveEvent and there must be anither way
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Yes a Timer.
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Last edited: Sep 5, 2015
    Creeperface likes this.
  8. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    or i can edit block placing
  9. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    PHP:
    if($hand->isSolid() === true and $hand->getBoundingBox() !== null){
    $entities $this->getCollidingEntities($hand->getBoundingBox());
    $realCount 0;
    foreach(
    $entities as $e){
    if(
    $e instanceof Arrow or $e instanceof DroppedItem or ($e instanceof Player && $e->isSpectator())){ //edited
    continue;
    }
    ++
    $realCount;
    }
    if(
    $player !== null){
    if((
    $diff $player->getNextPosition()->subtract($player->getPosition())) and $diff->lengthSquared() > 0.00001){
    $bb $player->getBoundingBox()->getOffsetBoundingBox($diff->x$diff->y$diff->z);
    if(
    $hand->getBoundingBox()->intersectsWith($bb)){
    ++
    $realCount;
    }
    }
    }
    if(
    $realCount 0){
    return 
    false//Entity in block
    }
    }
    will it work?
    DunxandMinecraft likes this.
  10. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    OMG it works now :333333
    DunxandMinecraft likes this.

Share This Page

Advertisement