Skip to content

Instantly share code, notes, and snippets.

@MTRNord
Created December 18, 2016 21:29
Show Gist options
  • Save MTRNord/c422b31062932ab734e56f3f7985c5ae to your computer and use it in GitHub Desktop.
Save MTRNord/c422b31062932ab734e56f3f7985c5ae to your computer and use it in GitHub Desktop.
How to change GameRules in Minecraft 1.11 with Forge
@EventHandler
public void onWorldLoad(FMLServerStartedEvent event) {
WorldServer worldServer = DimensionManager.getWorld(0); // default world
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "FakePlayer");
FakePlayer fakePlayer = new FakePlayer(worldServer, gameProfile);
MinecraftServer minecraftServer = fakePlayer.mcServer;
minecraftServer.getServer().worldServerForDimension(0).getGameRules().setOrCreateGameRule("randomTickSpeed", "3000");
}
@k4yfour
Copy link

k4yfour commented Jul 6, 2017

Thank you so much! I was having so much trouble

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment