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

Hi im making a mod on 1.7.10 and I have a block that I only want to spawn in oceans (all ocean biomes)

I'm quite new to modding and I can't really find much on the internet for this so I wanted to make this thread.

 

here is my current code

 

package com.swift.swiftsmod;

import java.util.Random;

import cpw.mods.fml.common.IWorldGenerator;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;

public class OreGeneration implements IWorldGenerator {

    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
            IChunkProvider chunkProvider) {
        switch (world.provider.dimensionId)

        {
        case 1:
            generateEnd(world, random, chunkX, chunkZ);
            break;

        case 0:
            generateOverworld(world, random, chunkX, chunkZ);
            break;

        case -1:
            generateNether(world, random, chunkX, chunkZ);
            break;
        }

    }

    public void generateEnd(World world, Random rand, int x, int z) {

    }

    public void generateOverworld(World world, Random rand, int x, int z) {
        generateOre(SwiftsMod.blockwaterOre, world, rand, x, z, 3, 9, 15, 1, 80, Blocks.stone);
        
        generateOre(SwiftsMod.blockmoneyOre, world, rand, x, z, 4, 14, 20, 1, 130, Blocks.stone); //4 min vien, 14 max vien, chance 20, 1 min level, 130 max level 

    }

    public void generateNether(World world, Random rand, int x, int z) {

    }

    public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, 
            int chance, int minY, int maxY, Block generateIn) {
        int veinSize = minVienSize + random.nextInt(maxVienSize - minVienSize);
        int heightRange = maxY - minY;
        WorldGenMinable gen = new WorldGenMinable(block, veinSize, generateIn);
        for(int i = 0; i < chance; i++){
            int xRand = chunkX * 16 + random.nextInt(16);
            int yRand = random.nextInt(heightRange) + minY;
            int zRand = chunkZ * 16 + random.nextInt(16);
            gen.generate(world, random, xRand, yRand, zRand);
            
        }
    }
}

 

 

  • Author

Follow up
I have made a normal block similar to stone but is not an ore. Where and how would I place it in and how would I make it generate in oceans only?

Ill try to give every detail needed

6 minutes ago, Swifts_Tech_Talks said:

Hi im making a mod on 1.7.10

Update to a modern version of Minecraft.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
Just now, Animefan8888 said:

Update to a modern version of Minecraft.

Thanks for the help...

and no. If I wanted to make a 1.14 mod I'd make a 1.14 mod

Edited by Swifts_Tech_Talks
adding text

1 minute ago, Swifts_Tech_Talks said:

Thanks for the help...

You're welcome.

 

1 minute ago, Swifts_Tech_Talks said:

and no. If I wanted to make a 1.14 mod I'd make a 1.14 mod

I didn't say 1.14 I said modern. And I say it because we don't support any versions below 1.12 because the changes are massive.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
Just now, Animefan8888 said:

You're welcome.

 

I didn't say 1.14 I said modern. And I say it because we don't support any versions below 1.12 because the changes are massive.

Where would I go to get help on this mod then? Because anything above 1.9 is absolute garbage

2 minutes ago, Swifts_Tech_Talks said:

Where would I go to get help on this mod then? Because anything above 1.9 is absolute garbage

I guess somewhere with people who share your opinion?

Edited by Animefan8888

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author
Just now, Animefan8888 said:

I guess somewhere with people who share your opinion?

Is there some old version mod support on this site? 

Just now, Swifts_Tech_Talks said:

Is there some old version mod support on this site? 

Nope.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Forge supports the current version (1.14 at the time of this writing) and one version back (ish, which is 1.12 at the time of this writing; 1.13 is sort of an interim version and was largely skipped). Sometimes it'll go back 2 versions (some help is available for 1.10, but won't be immediately locked).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Guest locked this topic
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.