Getting all blocks a player is standing on

Discussion in 'Plugin Development' started by HeyAwesomePeople, May 4, 2015.

Thread Status:
Not open for further replies.
  1. Hello!

    I am creating a TNTRun type game where I am trying to implement a system to automatically break the blocks you are standing on if you stand still for too long.

    For this so far I have tried to just use the cords to attempt to get all blocks a player is standing on but it seems long and not very efficient. So what I am asking is, how would I get all the blocks a player is standing on?

    I don't mean the one block directly below the player, I mean like the blocks a player is technically standing on. For example, if there is four blocks placed, you could stand in the middle of those four and any 3 could be destroyed and you would still be standing. If you were between two blocks and one was destroyed, you would still be standing.

    So yeah, how would I get all blocks a player is standing on? I have and will continue my clunky way but someone has had to have come up with a good solution before me.

    Thanks,
    HeyAwesomePeople
     
  2. Offline

    1Rogue


    Simply have a lower tolerance for your radius checks.

    So for example, if you're say, within 0.2 of a block edge, include both blocks. You can do a little homework and probably find the actual standing area of a player entity
     
Thread Status:
Not open for further replies.

Share This Page