Block detecting a player!?

Discussion in 'Plugin Development' started by unforgiven5232, May 2, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    unforgiven5232

    Hello, im trying to figure out a way to make it so when a player gets in the radius of a block, it'll do the code i want. Im clueless on what event to put it under.. T.T
     
  2. Offline

    Jake0oo0

    You can use a playerMoveEvent and check if they are on a certain block.
     
    unforgiven5232 likes this.
  3. Offline

    Malikk

    Yikes...

    I would make a scheduler for this. That way you could check it at further apart, fixed intervals and save the server a little hassle.
     
  4. Offline

    TheUpdater

    depends if you want an area like cube or something other wise use PlayerMoveEvent and check if player is on that block/in the block
     
  5. Offline

    unforgiven5232

    How would i do it if its a cube?

    TheUpdater Tag :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  6. Offline

    danthonywalker

    I would just use a .getNearbyEnties inside a scheduler if you are trying to detect within a certain area. getNearbyEntities works with entities, so you'll have to use an entity on the block (maybe something like particles?) and you can search nearby entities.

    Oh yeah, and hi unforgiven.
     
    unforgiven5232 likes this.
  7. Offline

    Jake0oo0

    Look in the resources area, pretty sure there is a guide to regions. Otherwise just create 4 locations, and check if the player is inside of those, if so, do wahtever.
     
Thread Status:
Not open for further replies.

Share This Page