Plugin Help Get if the block a player stepped on is a pressure plate

Discussion in 'Plugin Help/Development/Requests' started by awesomeness14721, Feb 13, 2015.

Thread Status:
Not open for further replies.
  1. Hello everyone! I have been searching around the forums and on google and I cannot seem to find the answer to my question. Pretty much what I am trying to do is to do something when a player steps on a pressure plate. Thanks in advance for any help :).

    <Edit by mrCookieSlime: Merged posts. Please don't double post. There is an Edit Button right next to the Date.>
     
    Last edited: Feb 13, 2015
  2. Offline

    mrCookieSlime

    @awesomeness14721
    Its not the wrong Section.
    And posting your Thread again will result in instant deletion and maybe even in a Warning for Spam.
    You can also request a move to a Section using the report Button.
     
  3. Lol yep got deleted. Alright I'll request to move, seeing as this section seems to be pretty empty
     
  4. Offline

    mrCookieSlime

    @awesomeness14721
    But it is the appropriate Section.
    You can only request a move if it was in the wrong one.
    However if you are using Spigot or Bukkit 1.8, this is the right place.
     
  5. Alrighty then
     
  6. Offline

    Boomer

    use PlayerInteractEvent and test

    if ((event.getAction().equals(Action.PHYSICAL))

    Then test if for example, event.getClickedBlock().getType().equals(Material.STONE_PLATE)

    If so, then get the block that is below the clicked block via your means of choice, location-vector addition, or BlockFace.DOWN etc, however you are wanting or most familiar with retreiving a block relative to another block(location)
     
  7. Alright so something like:
    Code:
    @EventHandler
    public void onInteract(PlayerInteractEvent e){
    if(e.getAction == Action.PHYSICAL){
    
    
    }
    }
    But how would I check the block they stepped on?
     
  8. Bump. Help needed
     
  9. Offline

    wxwsk8er

    Pseudo:

    Location playerWhere = player.getLocation()

    if(World.getBlock(playerWhere.x, playerWhere.y - 1, playerWhere.z).getMaterial = StonePlaye){
    Do stuff
    else
    Don't do stuff

    There you go!
     
  10. Thanks a ton!
     
  11. Offline

    wxwsk8er

    'welcome :)
     
Thread Status:
Not open for further replies.

Share This Page