Description of bug
I am creating a command to be used in the mod; the logic to throw a special java.lang.Throwable
that is able to throw in the runtime such as java.lang.Error
is defined in the command, and I did not implement any handling exceptions.
The problem is that when Minecraft Server handles execution of the command sent by the player, it doesn't handle any java.lang.Error
. Meanwhile, if the command is entered in the console of Dedicated Server, the server makes a crash as intended.
To reproduce, we should use a modified Minecraft version in the present, but it may also happen enough in the Vanilla environment.
Step to reproduce
On Integrated Server (Singleplayer world)
Install Fabric to the client
Apply the mod in Attachment 1 to move under
.minecraft/mods
directoryAlso apply Fabric API mod
Creating a new world or join existing
Enter
test
commandSee the server doesn't make a crash and continues
On Dedicated Server
Install Fabric Server
Apply the mod in Attachment 1 to move under
.minecraft/mods
directoryAlso apply Fabric API mod
Write script to run the server and execute it
Agree the EULA and re-run the server
Check the server has done the startup and join the server
Enter
test
commandSee the server doesn't make a crash and continues
Expected result
Server crashes and makes a crash report.
Attachments
Attachment 1
[[command/crash-test] 1.0.0-SNAPSHOT for Fabric|https://github.com/No-Eul/FabricTestMod/releases/tag/command/crash-test/1.0.0]
The test mod to reproduce the bug.
Command Information
| |
---|---|
4 | |
None |
Command Syntax
test
Attachment 2
import com.mojang.brigadier.CommandDispatcher;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.command.CommandRegistryAccess;
import net.minecraft.server.command.CommandManager;
import net.minecraft.server.command.ServerCommandSource;
public class TestCommand implements ModInitializer, CommandRegistrationCallback {
@Override
public void onInitialize() {
CommandRegistrationCallback.EVENT.register(this);
}
@Override
public void register(
CommandDispatcher<ServerCommandSource> dispatcher,
CommandRegistryAccess registryAccess,
CommandManager.RegistrationEnvironment environment
) {
dispatcher.register(
CommandManager.literal("test")
.requires(source -> source.hasPermissionLevel(CommandManager.field_31841))
.executes(ctx -> {
throw new Error("Manually triggered debug crash");
})
);
}
}
Source code of the test mod.
We don't accept bug reports that are only reproducible on modded clients or servers