Skip to content

Instantly share code, notes, and snippets.

@portablejim
Created March 15, 2018 13:11
Show Gist options
  • Save portablejim/424635b7e7b38d859530527019b5b341 to your computer and use it in GitHub Desktop.
Save portablejim/424635b7e7b38d859530527019b5b341 to your computer and use it in GitHub Desktop.
Hardcore Cheater source
package portablejim.hc;
import net.minecraft.init.Blocks;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.integrated.IntegratedServer;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartedEvent;
import net.minecraftforge.fml.server.FMLServerHandler;
@Mod(modid = HardcoreCheater.MODID, version = HardcoreCheater.VERSION, acceptedMinecraftVersions = "[1.10,1.13)")
public class HardcoreCheater
{
public static final String MODID = "hardcorecheater";
public static final String VERSION = "1.0";
@SuppressWarnings("unused")
@EventHandler
public void serverStart(FMLServerStartedEvent event) {
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
if(server.isSinglePlayer() && server.isHardcore()) {
server.getPlayerList().setCommandsAllowedForAll(true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment