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

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.

  • Author

I see. Is there an automated way to get a list of every mob for datapacks though?

  • 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 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.

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...

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.