Stop redstone from activating TNT/Getting blocks within range of location.

Discussion in 'Plugin Development' started by TwistedMexi, Nov 11, 2012.

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

    TwistedMexi

    I'm working on a TNT control plug-in, but there's a loophole caused by redstone activation. I've been trying to figure out how to stop redstone from triggering TNT without major overhead. I'd like to hear of an easy way if possible, but if not I need help on how to get blocks within range of a certain location (getting TNT blocks near a redstone block in this case)

    So, if there isn't an easier way of just stopping the TNT from priming (can't cancel it afterwards because there's no easy way to tell what activated it) then I need to know how to create a radius from a block, and check for blocks within that range.

    Any help is appreciated, thanks.
     
  2. Offline

    zachoooo

    Maybe BlockRedstoneEvent? And check if the block is next to tnt and remove the current?
     
    TwistedMexi likes this.
  3. Offline

    TwistedMexi

    Yeah, already went that route, problem was it got tricky if the tnt was 1 block down and next to the redstone, too much overhead. Ended up doing a hashmap.put when flint and steel was used on it. If it's not in the hashmap on prime, it cancels it and drops the tnt as an item instead.
     
Thread Status:
Not open for further replies.

Share This Page