Jump to content

[1.14.4] Dynamic block/entity/item etc based on other mods


MSpace-Dev

Recommended Posts

Is it possible to get all loaded entities in the registry (from all other mods) at runtime, to then be able to spawn in said entity within my mod? I feel it might be possible now, with how structured the registry events are in 1.14.

I am also trying to generate new entities at runtime based on this by using a builder pattern of sorts.

Link to comment
Share on other sites

I've been doing some research. What are your thoughts on this method?

	@SubscribeEvent
	public static void onRegisterEntities(final RegistryEvent.Register<EntityType<?>> event)
	{
		DeferredWorkQueue.runLater(() -> {
			entityBuilder(event);
		});
	}

	private static void entityBuilder(final RegistryEvent.Register<EntityType<?>> event)
	{
		ArrayList<EntityType<?>> all_entities;
		all_entities = (ArrayList<EntityType<?>>) event.getRegistry().getValues();

		Main.LOGGER.debug("ALL LOADED ENTITIES:");
		all_entities.forEach(p -> Main.LOGGER.debug(p));
	}

 

And will I be able to register new entities under new IDs using the methods within EntityType and ForgeRegistries.ENTITIES? (If I don't go with this method ^)

Edited by MSpace-Dev
Link to comment
Share on other sites

I want to expand my mod's features lots in 1.14.4. I want users to be able to specify mobIDs from other mods in JSON to initialise a new item, block and entity for the specified id. To do this, I need to be able to dynamically create these objects.

 

It would be perfect for my mod. You will be able to see that at a quick glance I think:

https://www.curseforge.com/minecraft/mc-mods/monster-totems

 

Link to comment
Share on other sites

  • MSpace-Dev changed the title to [1.14.4] Dynamic block/entity/item etc based on other mods

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.