Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey im in making og a mod and i have the ore and much other thing and i wonder why it dont spawn its really annoying thet its not work! D:

NEWB! in java im sorry :/

I'm sorry, my magical code viewing device is broken. Can you manually post your code please?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

package com.Ruby.RubyMod;

 

import java.util.Random;

 

import cpw.mods.fml.common.IWorldGenerator;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

 

public class WorldGenRuby implements IWorldGenerator{

 

public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){

switch (world.provider.dimensionId){

case -1:

generateNether(world, rand, chunkX * 16, chunkZ * 16);

case 0:

generateSurface(world, rand, chunkX * 16, chunkZ * 16);

}

}

 

private void generateSurface(World world, Random rand, int chunkX, int chunkZ){

for (int i = 0; i < 50000; i++){ // make 100 less then less spawn in 1 chunk

int randPosX = chunkX + rand.nextInt(16);

int randPosY = rand.nextInt(64); //From 0 to 64 Y cords

int randPosZ = chunkZ + rand.nextInt(16);

 

    (new WorldGenMinable(RubyMod.RubyOre, 10)).generate(world, rand, randPosX, randPosY , randPosZ);

}

}

 

private void generateNether(World world, Random rand, int i, int j) {

 

}

 

public static void register() {

 

}

}

 

 

 

 

 

Is my code

NEWB! in java im sorry :/

Where do you register it? And why are you attempting to generate the ore 50000 times?

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

  • Author

i did first have it at 100 but then i didnt find the ore and i sat the thing up and stil cant find it and what u mean register?

NEWB! in java im sorry :/

Methods don't get magically called.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

  • Author

I realy dont get it this is the code

 

 

package com.Ruby.RubyMod;

 

import java.util.Random;

 

import cpw.mods.fml.common.IWorldGenerator;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.feature.WorldGenMinable;

 

public class WorldGenRuby implements IWorldGenerator{

 

public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){

switch (world.provider.dimensionId){

case -1:

generateNether(world, rand, chunkX * 16, chunkZ * 16);

case 0:

generateSurface(world, rand, chunkX * 16, chunkZ * 16);

}

}

 

private void generateSurface(World world, Random rand, int chunkX, int chunkZ){

for (int i = 0; i < 50000; i++){ // make 100 less then less spawn in 1 chunk

int randPosX = chunkX + rand.nextInt(16);

int randPosY = rand.nextInt(64); //From 0 to 64 Y cords

int randPosZ = chunkZ + rand.nextInt(16);

 

    (new WorldGenMinable(RubyMod.RubyOre, 10)).generate(world, rand, randPosX, randPosY , randPosZ);

}

}

 

private void generateNether(World world, Random rand, int i, int j) {

 

}

 

public static void register() {

 

}

}

 

NEWB! in java im sorry :/

No, that's the Worldgen code. Post your main class. If you don't get it, follow a basic Java tutorial. You have to register your world generator.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Yeah, the register() method in WorldGenRuby that you are calling is empty. How is it supposed to do anything if you arent telling it to? Use this to register the WorldGenerator:

GameRegistry.registerWorldGenerator(new WorldGenRuby(), 1);

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

in your preinit method

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.