Checking if new location is water?

Discussion in 'Plugin Development' started by Trevor1134, Jun 27, 2013.

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

    Trevor1134

    I have this plugin that tps a user to a random location, but I want to check if that location is water, because it it is, I want it to re-check for a new location without water.

    Is this possible?
     
  2. Offline

    chasechocolate

    if(loc.getBlock().getType() == Material.WATER || loc.getBlock().getType() == Material.STATIONARY_WATER)
     
  3. Offline

    danslayerx

    If it is just liquid in particular (If you don't mind the user going into some lava, then this won't be helpful) you should be able to do something along the lines of.

    location.getBlock().isLiquid() I think.
     
  4. Offline

    Trevor1134

    chasechocolate That checks if the EXACT block is water, but usually with this command you get tp'ed high in the air, i want to check if the first block under me = water.
     
Thread Status:
Not open for further replies.

Share This Page