Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by AvaterysPL, Sep 16, 2018 at 4:00 PM.
From a quick search, apparently this error can be caused by setting the block a player is placing to air, as players cannot place air.
I dunno why you check that the action is right click air so many times if you only need to do it once. If you use right_click_block, I'd guess that's most likely to be where the error is.
Some other tips:
- It's not good practice to hard-code color characters. Instead, use the org.bukkit.ChatColor enum
- Method names should be written in lowerCamelCase. Only class names should be UpperCamelCase.
- Before using e.getItem(), you should check that the item isn't null and its type isn't air. It'll only be one or the other, but I don't quite remember which in this case.
i tried but I still can not do this
Post the entire method/class into pastebin and link it here or use [ code ] [/code] brackets.
Anyways, try cancelling the event before you remove the item in their inventory. Also, you don't need that OfflinePlayer e. You can just remove it.
Working Thanks for help
Don't forget to mark as solved ^^.