Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public static void setGameRule(World world, String rule, String value) {
  2. try {
  3. Object WorldServer = world.getClass().getMethod("getHandle").invoke(world);
  4. Object GameRule = WorldServer.getClass().getMethod("getGameRules").invoke(WorldServer);
  5. GameRule.getClass().getMethod("set", String.class, String.class).invoke(GameRule, rule, value);
  6. } catch(Exception e) {
  7. e.printStackTrace();
  8. }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement