Cancel block placement if block is x distance away from torch

Discussion in 'Plugin Development' started by voltywolty, Dec 1, 2021.

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

    voltywolty

    Hey all. I'm trying to cancel block placement if the the block is placed near a redstone torch or rail, or other specific blocks. How could I go about this?
     
  2. Offline

    xelatercero

    Maybe i'm wrong but when the block is placed in the BlockPlaceEvent i would check an area , for example, a 4x4 (x,y,z) with a for loop and just check the type of block in every position in that area and if is a torch , cancell the event. Sorry for my english, and maybe this is not the best aproach?
     
  3. Offline

    voltywolty

    May not be the best wise, but it could still work. I can give it a shot. Thank you for the idea.
     
Thread Status:
Not open for further replies.

Share This Page