Solved Testing For a Click on a Certain Block

Discussion in 'Plugin Development' started by SirMonkeyFood, Feb 18, 2016.

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

    SirMonkeyFood

    Hey there, I'm working on a quick plugin to redirect users to a certain command, but for some reason my plugin isn't working. Essentially, the plugin just tests for a cobblestone wall (with an end portal frame two blocks underneath it to ensure it's the right wall), and sudos them from console. I have referenced older plugins on my other computer and still no dice. No stack traces either.

    Any help would be appreciated, thanks! :D

    Plugin.yml: http://pastebin.com/eJW9q8wH

    Main Class: http://pastebin.com/QGTeLWXM

    Player Listener: http://pastebin.com/XhfY9vtk
     
  2. Offline

    Xerox262

    @SirMonkeyFood You're checking if a block is equal to an Material, this can never be true, instead you need to check if the block's type is equal to the material (You can use == as well btw, it's an enum) Also you don't need to check that the clicked block is not null, it can't be not null because the player has to actually click on a block for the action to be block and not air, you do however need to check that l.getBlock() is not null.

    Also, why sudo the player from console when you could just force the player to run the command using
    Bukkit.dispatchCommand(player,"furnace");
     
    SirMonkeyFood likes this.
  3. Offline

    SirMonkeyFood

    @Xerox262 I knew it was something stupid, thanks man <3
    Also, thanks for the tip!
     
Thread Status:
Not open for further replies.

Share This Page