setblock one block ahead where the player is walking towards to

Discussion in 'Plugin Development' started by dxrknez, Apr 8, 2018.

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

    dxrknez

    im making a plugin when u walk theres block spawning under u but i also want to spawn like one block ahead of them how do i do that
     
  2. Offline

    CommonSenze

    @dxrknez
    What you would want to do is first get the players direction (Look at this to find out how)
    Then you would want to get the block below the player and with the direction the players facing, on a move event, set the block relative to the direction below the player to a block.
     
    Last edited by a moderator: Apr 9, 2018
  3. Offline

    MightyOne

    Code:
    Player.getLocation().add(Player.getLocation.getDirection())
    But its not guaranteed that the block is visible, maybe its in the ground
     
Thread Status:
Not open for further replies.

Share This Page