Solved [URGENT]Nothing is working...

Discussion in 'Plugin Development' started by Philitup321, Aug 30, 2013.

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

    Philitup321

    Hello!!! I am trying to make a plugin where when a player makes a sign with the first line reading "pig" , it would create a shop sign that would charge them when the right click it. I incorporated Vault, but now nothing works. The sign as well as the command worked fine before, but now nothing is working. Please help me.

    Code : http://pastebin.com/YcVCy1B2
     
  2. Offline

    mydeblob

    It looks like to me, that you just switched up some if loops.
    Switch this
    Code:java
    1. @EventHandler
    2. public void onPigSignClick(PlayerInteractEvent ev){
    3. if (ev.getAction() == Action.RIGHT_CLICK_BLOCK) {
    4. Block b = ev.getClickedBlock();
    5. Player player = ev.getPlayer();
    6. EconomyResponse r = econ.withdrawPlayer(player.getName(), 1000);
    7. if(r.transactionSuccess()){
    8. if ((b.getType() == Material.SIGN_POST) || (b.getType() == Material.WALL_SIGN)) {
    9. Sign s = (Sign)b.getState();
    10. Player p = ev.getPlayer();
    11. if (s.getLine(2).equalsIgnoreCase(ChatColor.YELLOW + "Piggy")){
    12. }

    To this
    Code:java
    1. @EventHandler
    2. public void onPigSignClick(PlayerInteractEvent ev){
    3. if (ev.getAction() == Action.RIGHT_CLICK_BLOCK) {
    4. Block b = ev.getClickedBlock();
    5. Player player = ev.getPlayer();
    6. if ((b.getType() == Material.SIGN_POST) || (b.getType() == Material.WALL_SIGN)) {
    7. Sign s = (Sign)b.getState();
    8. Player p = ev.getPlayer();
    9. if (s.getLine(2).equalsIgnoreCase(ChatColor.YELLOW + "Piggy")){
    10. EconomyResponse r = econ.withdrawPlayer(player.getName(), 1000);
    11. if(r.transactionSuccess()){
    12. //Do stuff here....
    13. }
     
  3. Offline

    Philitup321

    Sorry, but that didn't help :(
     
  4. Offline

    mydeblob

    Philitup321
    What's not working about it? Is it giving errors? Or just not working at all
     
  5. Offline

    Philitup321

    There are no errors what so ever, and it says that the plugin has been loaded successfully. Nothing , even the sign creation and commands aren't working.
     
  6. Offline

    xxMOxMOxx

    For the signs, it currently is looking for line 3 to say Piggy, not pig on line 1 like you said in your first post. Are the commands recognized or does it say "Unknown command"?
     
  7. Offline

    Philitup321

    They are an "Unknown command"
     
  8. Offline

    xxMOxMOxx

    Did you register commands in the plugin.yml?
     
  9. Offline

    Philitup321

    Yes, as well as the dependency for vault. xxMOxMOxx

    Any More Ideas? xxMOxMOxx & mydeblob

    Anyone? Please help me.

    Anyone?!?!? Please?!?!? I really need help with this.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
Thread Status:
Not open for further replies.

Share This Page