Jump to content

Buecher_wurm

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Buecher_wurm

  1. So, I created an example repository with my problem, might be easier to understand then my explanation https://github.com/tristankechlo/BiomeTagsForBiomeLoadingEvent
  2. I created and registered several placed features through code (not json based) Now I need to add them to vanilla biomes, for this I created biome tags for the biomes the features are supposed to generate in. the biome tag is created at: /data/example_mod/tags/worldgen/biome/has_feature/large_mushroom.json the biome tag is referenced in my code like this: public static final TagKey<Biome> HAS_FEATURE_LARGE_MUSHROOM = getTagKey("has_feature/large_mushroom"); /* more tags created similar */ private static TagKey<Biome> getTagKey(String id) { return TagKey.create(Registry.BIOME_REGISTRY, new ResourceLocation("example_mod", id)); } my BiomeLoadingEvent (registered to the forge eventbus) public static void onBiomeLoad(final BiomeLoadingEvent event) { Biome biome = ForgeRegistries.BIOMES.getValue(event.getName()); boolean isCorrectBiome = ForgeRegistries.BIOMES.tags().getTag(HAS_FEATURE_LARGE_MUSHROOM).contains(biome); //always false } It looks like the biome tags are not filled/validated when the BiomeLoadingEvent is fired? but using the command `/locatebiome #example_mod:has_feature/large_mushroom` works without problems Am I missing something, or is there another way of adding my features to biomes without hardcoding them?
  3. the eventhandler is 100% called, because the entity will spawn in overworld biomes when I change the category check all overworld biomes seem to be working fine
  4. in end biomes it does not spawn at all, checked with /kill by entity type
  5. except that the mob is not spawning in the end, everything works the way I want it to
  6. Is there anything special I need to do to spawn my custom entity in the end? I can let it spawn in all overworld biomes without a problem. BiomeLoadingEvent with mesa biomes and end biomes as example, the entity will then spawn only in mesa biomes, but not in the end @SubscribeEvent(priority = EventPriority.HIGH) public static void onBiomeLoading(BiomeLoadingEvent event) { if (event.getCategory() == BiomeCategory.MESA || event.getCategory() == BiomeCategory.THEEND) { event.getSpawns().addSpawn(MobCategory.CREATURE, new SpawnerData(ModEntityTypes.BABY_ENDER_DRAGON.get(), 100, 2, 5)); } } for testing i registered a custom SpawnPredicate that returns always true
  7. I am trying to spawn my custom entity in a nether fortresses. What I tried so far is using the WorldEvent.PotentialSpawns event, but that did not really work out My code so far @SubscribeEvent public void onFeatureRegistry(final WorldEvent.PotentialSpawns event) { if (event.getType() == EntityClassification.MONSTER) { boolean isFortress = ((ServerWorld) event.getWorld()).structureFeatureManager() .getStructureAt(event.getPos(), true, Structure.NETHER_BRIDGE).isValid(); boolean isNetherBrick = event.getWorld().getBlockState(event.getPos().below()) .getBlock() == Blocks.NETHER_BRICKS; if (isFortress && isNetherBrick) { Main.LOGGER.info("ADDED " + event.getPos().toShortString()); event.getList().add(new Spawners(ModEntityTypes.NETHER_KNIGHT_ENTITY.get(), 50, 5, 5)); } } } the conditions are definitely met, because my log message is triggered when I am near a fortress, but my mob does not spawn. Even with a higher item weight for the Spawners it does not work.
  8. Is there a way to register a recipe only if specific mod is loaded? I created a json-recipe for the Patchouli book of my mod. As long as Patchouli is installed everything works fine. But if not the recipes produces (obviously) some errors, so I want to ask if there is something I could do to prevent these errors.
×
×
  • Create New...

Important Information

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