📅  最后修改于: 2022-03-11 14:52:48.458000             🧑  作者: Mango
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
String commandShowDeathMessages = "gamerule showDeathMessages false";
Bukkit.dispatchCommand(console, commandShowDeathMessages);
// But don't forget to write them by yourself in PlayerDeathEvent
// PS: btw if you plan to run that command on plugin onEnable,
//you shouhld use it in BukkitRunnable.runTaskLater()