LuckPerms

LuckPerms

905k Downloads

Bug/Regression: Crash related to resolving command selectors

GrahamJenkins opened this issue ยท 1 comments

commented

Description

I have previously used commands in datapacks that would run something like /execute as @p[discance=..10] run lp user @s parent add ... (It was actually run inside an execute unless permission... )
This worked in an old server running LuckPerms-Fabric-5.4.102.
I am now running LuckPerms-Fabric-5.4.140.

I recently set up a new 1.21 server, and while the LP command works as a user, it appears to have regressed and crashes the server if a server based LP command attempts to resolve a command selector.

Note: I do have resolve-command-selectors = true set.

The error thrown is as follows:

[Server thread]: [MinecraftServer] Encountered an unexpected exception
java.lang.NoSuchMethodError: 'net.minecraft.class_2300 net.minecraft.class_2186.method_61178(com.mojang.brigadier.StringReader)'
        at knot/me.lucko.luckperms.fabric.FabricCommandExecutor.resolveSelectors(FabricCommandExecutor.java:90) ~[LuckPerms-Fabric-5.4.140.jar:?]
        at knot/me.lucko.luckperms.fabric.FabricCommandExecutor.resolveSelectors(FabricCommandExecutor.java:46) ~[LuckPerms-Fabric-5.4.140.jar:?]
        at knot/me.lucko.luckperms.common.command.BrigadierCommandExecutor.run(BrigadierCommandExecutor.java:68) ~[LuckPerms-Fabric-5.4.140.jar:?]
        at knot/com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
        at knot/net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:29) ~[?:?]
        at knot/net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13) ~[?:?]
        at knot/net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[?:?]
        at knot/net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:8) ~[?:?]
        at knot/net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:107) ~[?:?]
        at knot/net.minecraft.commands.Commands.executeCommandInContext(Commands.java:379) ~[?:?]
        at knot/net.minecraft.commands.Commands.performCommand(Commands.java:309) ~[?:?]
        at knot/net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:1319) ~[?:?]
        at knot/net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$7(ServerGamePacketListenerImpl.java:1307) ~[?:?]
        at knot/net.minecraft.server.TickTask.run(TickTask.java:18) ~[?:?]
        at knot/net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:162) ~[?:?]
        at knot/net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
        at knot/net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:864) ~[server-intermediary.jar:?]
        at knot/net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:173) ~[server-intermediary.jar:?]
        at knot/net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:136) ~[?:?]
        at knot/net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:846) ~[server-intermediary.jar:?]
        at knot/net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:840) ~[server-intermediary.jar:?]
        at knot/net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:145) ~[?:?]
        at knot/net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:810) ~[server-intermediary.jar:?]
        at knot/net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:815) ~[server-intermediary.jar:?]
        at knot/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:702) ~[server-intermediary.jar:?]
        at knot/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:281) ~[server-intermediary.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

Note: I can provide a full crash report if that's useful.

Similar/related to #3626 but I suspect this was resolved (it worked more recently than that issue) and there is a more recent regression.

Reproduction Steps

(untested)
Run a Fabric server, v1.21
Install LuckPerms-Fabric-5.4.140
Create a command block with the command: lp user @p parent add default

This should result in a server crash.

Expected Behaviour

Command should run properly as it did in the past, rather than throwing an error and crashing the server.

Server Details

fabric-server-mc.1.21-loader.0.16.9

LuckPerms Version

LuckPerms-Fabric-5.4.140

Logs and Configs

No response

Extra Details

No response

commented

Just checking in, is anyone able to verify that this is an active bug?