Posted November 2, 20213 yr Hello. I'm currently trying to make a config to build a list of all registered LivingEntity instances from both installed mods and vanilla. Right now I'm attempting to use ForgeConfigSpec, but there's no documentation for it so I'm not sure what I'm doing. package com.cwjn.hardstuckintegration.Config; import net.minecraft.entity.EntityClassification; import net.minecraft.entity.EntityType; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.registries.ForgeRegistries; public class ResistancesConfig { public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final ForgeConfigSpec SPEC; static { for (EntityType<?> entity : ForgeRegistries.ENTITIES.getValues()) { EntityClassification type = entity.getCategory(); if (type == EntityClassification.CREATURE || type == EntityClassification.MONSTER || type == EntityClassification.WATER_CREATURE) { BUILDER.define("test_config_option_1_" + entity.toString(), 0.0f); BUILDER.define("test_config_option_2_" + entity.toString(), 0.0f); BUILDER.pop(); } } SPEC = BUILDER.build(); } } I guess the question would be, is there a better/easier way to do this? Someone has recommended using a JSON loader on startup, but before I go and learn how to do that I want to see if there's a way to make this work.
November 2, 20213 yr Author I see. Is there an automated way to get a list of every mob for datapacks though?
November 2, 20213 yr Author The end goal of this is to apply a set of capabilities to every registered mob in the game, including any mods. I figure the best way to do this would be to autogenerate a list of all registered mobs in some sort of config file, which then will send the values (3 floats) to my capability handler. Edited November 2, 20213 yr by cwJn
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.