Added .respawn command
package com.matt.forgehax.mods.commands;
import static com.matt.forgehax.Helper.getGlobalCommand;
+import static com.matt.forgehax.Helper.getLocalPlayer;
import static com.matt.forgehax.Helper.getModManager;
import com.google.common.util.concurrent.FutureCallback;
@@ -203,4 +204,20 @@ public class HelpCommand extends CommandMod {
})
.build();
}
+
+ @RegisterCommand
+ public Command respawn(CommandBuilders builder) {
+ return builder
+ .newCommandBuilder()
+ .name("respawn")
+ .description("Send respawn packet")
+ .processor(
+ data -> {
+ if (getLocalPlayer() != null) {
+ getLocalPlayer().respawnPlayer();
+ data.write("Respawn packet sent");
+ } else data.write("Failed to send respawn packet (player is null)");
+ })
+ .build();
+ }
}
