Click event doesn't work for non-op players

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

j03ri

Member
Nov 30, 2019
2
0
0
I am trying to make a gui where you can equip different particle effects. I am using a mix of minecraft commands and skript (or TuSKe). It's working ok for people with op, not for people without. How do I fix this?
The GUI opens, but when a non-op player clicks the item, it doesn't execute the command.

This is the script I'm using:
Code:
command /particlemenu:
    trigger:
        open chest inventory with 6 rows named "                 Aura's" to player
        set {_empty} to gray glass pane named " "
        set {_unk} to red glass pane named " "
        set {_flame} to melon seeds named "&5Flame"
        format gui slot 10 of player with {_flame} to execute player command "trigger trig_aura_flame"

I'm using the latest version of TuSKE,
Skript 2.4-beta10
Minecraft Paper 1.14.4

Thanks in advance
 
Make sure the player has the permission to run the command /trigger trig_aura_flame.
The reason why it works for players with op is because people with op naturally have every single permission in the server regardless of what group they are apart of, players without op do not. If you don't have a permission set for /trigger, just add a permission and give all of the groups in the server that permission, unless there are groups that you don't want to have access to that command.
 
That's the problem, the groups already have the permission. They can use the command in chat, but cannot trigger it in the GUI.
This is the ERROR message in the console when a player clicks the item in the GUI:

Code:
[14:33:42 ERROR]: Could not pass event InventoryClickEvent to Skript v2.4-beta10
java.lang.NullPointerException: permission
        at me.lucko.luckperms.bukkit.inject.permissible.LPPermissible.addAttachment(LPPermissible.java:263) ~[?:?]
        at me.lucko.luckperms.bukkit.inject.permissible.LPPermissible.addAttachment(LPPermissible.java:72) ~[?:?]
        at org.bukkit.craftbukkit.v1_14_R1.entity.CraftHumanEntity.addAttachment(CraftHumanEntity.java:254) ~[patched_1.14.4.jar:git-Paper-209]
        at com.github.tukenuke.tuske.util.CommandUtils.runCommand(CommandUtils.java:37) ~[?:?]
        at com.github.tukenuke.tuske.sections.gui.EffFormatGUI.lambda$execute$0(EffFormatGUI.java:132) ~[?:?]
        at com.github.tukenuke.tuske.manager.gui.GUI.run(GUI.java:29) ~[?:?]
        at com.github.tukenuke.tuske.manager.gui.GUIManager$1.onClick(GUIManager.java:149) ~[?:?]
        at com.github.tukenuke.tuske.listeners.GUIListener.onEvent(GUIListener.java:57) ~[?:?]
        at com.github.tukenuke.tuske.manager.gui.v2.SkriptGUIEvent.check(SkriptGUIEvent.java:39) ~[?:?]
        at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:150) ~[?:?]
        at ch.njol.skript.SkriptEventHandler$1.execute(SkriptEventHandler.java:114) ~[?:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.14.4.jar:git-Paper-209]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.14.4.jar:git-Paper-209]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:545) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:2310) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.PacketPlayInWindowClick.a(SourceFile:33) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:1029) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:1022) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1006) ~[patched_1.14.4.jar:git-Paper-209]
        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:929) ~[patched_1.14.4.jar:git-Paper-209]
        at java.lang.Thread.run(Unknown Source) [?:?]
 
I am trying to make a gui where you can equip different particle effects. I am using a mix of minecraft commands and skript (or TuSKe). It's working ok for people with op, not for people without. How do I fix this?
The GUI opens, but when a non-op player clicks the item, it doesn't execute the command.

This is the script I'm using:
Code:
command /particlemenu:
    trigger:
        open chest inventory with 6 rows named "                 Aura's" to player
        set {_empty} to gray glass pane named " "
        set {_unk} to red glass pane named " "
        set {_flame} to melon seeds named "&5Flame"
        format gui slot 10 of player with {_flame} to execute player command "trigger trig_aura_flame"

I'm using the latest version of TuSKE,
Skript 2.4-beta10
Minecraft Paper 1.14.4

Thanks in advance

execute console command, not player command
 
Status
Not open for further replies.