Help
Closed this issue ยท 25 comments
Hello dear developers!
I have a question. How can I add a player to group with api? I don't understand it in Developer API :/ Please help with code.
user.setPermission(luckPermsApi.makeGroupNode(...))
There are examples here.
https://github.com/lucko/LuckPerms/wiki/Developer-API#adding-a-permissionparentprefixsuffixmetadata-to-a-usergroup
Again, that's not the method I said. It's makeGroupNode
, not buildGroupNode
.
Secondly, you shouldn't be casting the Node.Builder to Node. Call the #build
method.
I've already given you an example, and there are more examples on the wiki page. (which I've also linked already)
But I don't understand the Developer api :/ I can't do this :/ If I run the "lp user user parent set group" command, I have an error in console...Why?
[17:31:38 ERROR]: Command Dispatched Async: lp user S3nS3IW00 parent set vip
[17:31:38 ERROR]: Please notify author of plugin causing this execution to fix this bug! see: http://bit.ly/1oSiM6C
java.lang.Throwable: null
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:656) [patched_1.12.2.jar:git-Paper-1262]
at hu.endercraft.managers.termekManager.giveVIP(termekManager.java:19) [ECCore.jar:?]
at hu.endercraft.events.EventHandlers.onChat(EventHandlers.java:643) [ECCore.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor53.execute(Unknown Source) [?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:70) [patched_1.12.2.jar:git-Paper-1262]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) [patched_1.12.2.jar:git-Paper-1262]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [patched_1.12.2.jar:git-Paper-1262]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:515) [patched_1.12.2.jar:git-Paper-1262]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:497) [patched_1.12.2.jar:git-Paper-1262]
at net.minecraft.server.v1_12_R1.PlayerConnection.chat(PlayerConnection.java:1386) [patched_1.12.2.jar:git-Paper-1262]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1301) [patched_1.12.2.jar:git-Paper-1262]
at net.minecraft.server.v1_12_R1.PacketPlayInChat$1.run(PacketPlayInChat.java:39) [patched_1.12.2.jar:git-Paper-1262]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_151]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_151]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user "+player.getName()+" parent set vip");
That's not a LuckPerms related error.
You're dispatching the command from an async thread, which is unsafe.
As the error says, you need to inform the author of hu.endercraft.managers.termekManager.giveVIP
, and ask them to fix the issue.
[17:31:38 ERROR]: Command Dispatched Async: lp user S3nS3IW00 parent set vip
[17:31:38 ERROR]: Please notify author of plugin causing this execution to fix this bug! see: http://bit.ly/1oSiM6C
java.lang.Throwable: null
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:656) [patched_1.12.2.jar:git-Paper-1262]
at hu.endercraft.managers.termekManager.giveVIP(termekManager.java:19) [ECCore.jar:?]
at hu.endercraft.events.EventHandlers.onChat(EventHandlers.java:643) [ECCore.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor53.execute(Unknown Source) [?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:70) [patched_1.12.2.jar:git-Paper-1262]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) [patched_1.12.2.jar:git-Paper-1262]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [patched_1.12.2.jar:git-Paper-1262]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:515) [patched_1.12.2.jar:git-Paper-1262]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:497) [patched_1.12.2.jar:git-Paper-1262]
at net.minecraft.server.v1_12_R1.PlayerConnection.chat(PlayerConnection.java:1386) [patched_1.12.2.jar:git-Paper-1262]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1301) [patched_1.12.2.jar:git-Paper-1262]
at net.minecraft.server.v1_12_R1.PacketPlayInChat$1.run(PacketPlayInChat.java:39) [patched_1.12.2.jar:git-Paper-1262]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_151]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_151]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
^^ Please read what it says. ^^
The error was thrown because the command was invoked async. It has nothing to do with the command actually being ran.
The error also directs you to a forum post which explains the issue in more detail.
https://www.spigotmc.org/threads/plugins-triggering-commands-async.31815/
This is NOT a luckperms issue.