Skip to content

Instantly share code, notes, and snippets.

@portablejim
Created September 27, 2016 07:51
Show Gist options
  • Save portablejim/4be779d16c65308f6c73f9f8cdb8acca to your computer and use it in GitHub Desktop.
Save portablejim/4be779d16c65308f6c73f9f8cdb8acca to your computer and use it in GitHub Desktop.
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)
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