How to temporarily add blocks where the player is looking

Discussion in 'Plugin Development' started by Monteven, Dec 23, 2014.

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

    Monteven

    An example would be if the player is looking at a block, place down 9 clay blocks. After they have moved their head to another block, remove those previous blocks and place the new ones. I have seen it possible in vanilla with command blocks, but is it possible in bukkit/spigot?
     
  2. Offline

    Skionz

  3. Offline

    TheMintyMate

    @Monteven
    Use @Skionz link to workout how to get the blocks form the block the player is looking at.

    ♦ Create a block iterator
    ♦ Get the block (A) a player is looking at (set a cap of around 40 to stop potential server crashes)
    ♦ add 9 blocks from block (A) towards the player
    ♦ Loop through the 9 blocks and change their material (too clay if you so desired)

    Hope this helped somewhat,
    - Minty
     
    ChipDev likes this.
Thread Status:
Not open for further replies.

Share This Page