1.8.8 KitGui: Why do I always get this message?

Discussion in 'Spigot Plugin Development' started by jvstin2k, Jan 27, 2020.

  1. Hey Guys!
    I made a KitGui plugin and I wanted to check if the player has (not) the permission, then he should just get a message, else he gets this kit. But why is it not working?

    Output in Minecraft if I click the Kit "pvp", is "no permission" (Keine Rechte, german), even If im op.

    Thanks for your help!
     

    Attached Files:

  2. Are you registering your permissions programmatically or in plugin.yml?
     
  3. Are you sure the player has the said permission ?

    By the way, it is recommonded to use bracket even if it's only line (1) line after the if/else statement, use proper indentation
     
  4. because youre closing an if-statement with ;. because of this, your brackets are out of whack. this would be apparent if you kept your spacing correct. look at where you're missing brackets. fix it.
     
  5. Programmatically.
     
  6. Yes, the player has the permission!
     
  7. I tried many times but it wont work
     
  8. if(!(p.hasPermission("essentials.kits.pvp")))
    {
    p.sendMessage(main.prefix + "Keine Rechte!");
    }
    else
    {
    ...
    }
     
    • Agree Agree x 1
  9. ok. not very detailed. cant help u there. lol
     
    • Funny Funny x 1
  10. Show your new code.
     
  11. But if you HAVE the permission, you WILL get "Du hast keine Rechte für..."
    AND
    You put a semicolon after the if-clause
     
  12. Choco

    Moderator

    @Warren1001 is correct here. You've mistakenly terminated an if statement.

    [​IMG]
     
    • Agree Agree x 1
  13. Yup, please mark as solved :)
     
    • Agree Agree x 1