Jump to content

[1.14.4] Spawn Entity in Village


GenreShinobi

Recommended Posts

I'd like to spawn an entity in a village, but I'm not sure how. I'm able to spawn the entity in biomes, but making it specific to villages is proving much harder. Any advice? 

 

My current general biome spawning:

   public static void setupEntitySpawning() { 
        EntityClassification kitsuneClassification = EntityClassification.MISC;

        for(BiomeManager.BiomeType btype : BiomeManager.BiomeType.values()) {
            for (BiomeManager.BiomeEntry biomeEntry : BiomeManager.getBiomes(btype)) {
                biomeEntry.biome.getSpawns(kitsuneClassification).add(new Biome.SpawnListEntry(ModEntity.KITSUNE, 10, 1,1));
            }
        }
    }

pre widget

Edited by GenreShinobi
Link to comment
Share on other sites

  • 3 weeks later...
13 minutes ago, GenreShinobi said:

Bump, anyone have an idea on how to get them to spawn in villages?

Are we talking a limited number of times. Like on generation? OR are we talking continuous spawns, but only ever in a village?

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.

Link to comment
Share on other sites

1 minute ago, GenreShinobi said:

A limited number of times on generation. 

From a brief look it seems that it might be possible with reflection. I'll point you in the appropriate direction. Each Biome a village spawns in has it's own area. For the Plains biome it's PlainsVillagePools In there is a static {} and an init, but init does nothing except make sure the static{} gets called.I've notified that all the parts including the part where entities spawning in structures is handled by the JigsawManager REGISTRY. It loads up nbt files from the data directory, use an NBT explorer to figure out the structure so you can create one for your Entity and then you'll have to somehow put it in the JigsawManager's registry entry.

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.

Link to comment
Share on other sites

Unfortunately it doesn't seem like I'm figuring this out >,<

Currently I have a class called EntitySpawning

public class EntitySpawning {
    public static void init() {
    }

    static {
        JigsawManager.REGISTRY.register(new JigsawPattern(new ResourceLocation("minecraft", "village/common/kitsune_entity"), new ResourceLocation("empty"), ImmutableList.of(new Pair<>(new SingleJigsawPiece("village/common/kitsune_entity"), 1)), JigsawPattern.PlacementBehaviour.RIGID));
    }
}

 

And during setup I have this: 

    // Setup
    private void setup(final FMLCommonSetupEvent event) {
        // Ore Generation
        OreGeneration.setupOreGeneration();

        // Entity Spawning
        EntitySpawning.init();

        // Initializations
        proxy.init();
    }

 

I have an nbt in data > minecraft > structures > village > common > kitsune_entity.nbt

kitsune_entity.nbt

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.