Location messages

Discussion in 'Plugin Development' started by M1dude, Jun 26, 2012.

  1. Offline

    M1dude

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I know how to get the location of a block, but how do I make the plugin say the location to the player?
  2. Offline

    M1dude

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Also, what is the name of TNT? It will recognize Wool, but not TNT.
  3. Offline

    ferrybig

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    1. sender.sendMessage(location.toString()); // You didn't say what format, :p

    2. Material.TNT
  4. Offline

    M1dude

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  5. Offline

    ferrybig

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    it is just java code, where player is your Player object, location is your Location object
  6. Offline

    M1dude

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Code:
            public void onBlockPlaceEvent(BlockPlaceEvent event){
                Block block = event.getBlockPlaced();
             
                if (block instanceof Material.TNT){
    }
    }
    It still wont recognize it. :(

    Is something wrong?

    This post has been edited 2 times. It was last edited by M1dude Jun 26, 2012.
  7. Offline

    ferrybig

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    why not?
  8. Offline

    M1dude

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It says that it can't be resolved as a type.
  9. Offline

    ferrybig

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    you need to import the Material class from bukkit
  10. Offline

    Pandemoneus

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Not that Block will ever be instanceof a Material though...

    @M1dude
    Rather check
    if (block.getType() == Material.TNT)
    M1dude likes this.
  11. Offline

    M1dude

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thanks!

Share This Page