Jump to content

[1.14.3] Feature Registration


Ellbelly

Recommended Posts

EDIT: I think I need to add the feature to a biome generation. I should have seen someone posted something similar just before.

 

EDIT 2: Welp I think I figured it out haha... almost... I believe its because diamond blocks can be placed on air whereas flowers cannot so its spawning them in the air.

apzqvUa.png

 

I'm trying to register a flower feature generation and I think I figured out how I need to register it but nothing is generating so I'm not sure if I'm doing it quite right.

 

This is the code I'm using to register the feature and this is getting called in the constructor of my main class.

ModFlowersFeature flowersFeature = new ModFlowersFeature(NoFeatureConfig::deserialize);
flowersFeature.setRegistryName("mod_flowers");
ForgeRegistries.FEATURES.register(flowersFeature);

 

And this is the flower feature and I'm using diamond blocks so that i can easily see if it works.

public class ModFlowersFeature extends FlowersFeature {

    public ModFlowersFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> featureConfig) {
        super(featureConfig);
    }

    public BlockState getRandomFlower(Random random, BlockPos pos) {
         return Blocks.DIAMOND_BLOCK.getDefaultState();
    }
}

 

If anyone knows what I'm doing wrong I would really appreciate the help.

Edited by Ellbelly
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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