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

Detecting entity/block collisions

Comments in 'Plugin Development' started by MCPEPIG, Jan 4, 2016.

  1. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    How can I detect when a player collides with a block or an entity?
  2. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Try
    PHP:
    if($player->isCollided == true) {
      
    //code
    }
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Try $player->getBoundingBox()->intersectsWith($otherEntityOrBlock->getBoundingBox())

Share This Page

Advertisement