Skip to content

Improved entity management for Dubious Container - #826

Open
Hiiragi283 wants to merge 4 commits into
Rearth:26.1from
Hiiragi283:26.1
Open

Improved entity management for Dubious Container#826
Hiiragi283 wants to merge 4 commits into
Rearth:26.1from
Hiiragi283:26.1

Conversation

@Hiiragi283

@Hiiragi283 Hiiragi283 commented Aug 19, 2026

Copy link
Copy Markdown

Description

Improved entity management for Dubious Container by using entity tags instead of direct value list.
With this change, players and addon developers can freely customize which entities can be captured via tags.

In addition, I found an potential issue which ComponentContent.ENERGY accepts negative energy value.
So I just replaced Codec.INT with ExtraCodecs.NON_NEGATIVE_INT to resolve this small problem.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. All changes have to be tested ingame on both loaders, and if any client-side code is involved, also on
a dedicated server to avoid any issues there.

  • Feature has been tested ingame on both neoforge and fabric.
  • Optional additional testing details

Checklist:

  • My code uses the 'var' keyword where applicable.
  • [N/A] I have commented my code, particularly in hard-to-understand areas

@Rearth

Rearth commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Hi, thanks for this PR. This looks mostly good, but why is the entity type tag not used directly in the item code, and is instead put into a data component that is then loaded in the item code? This sounds a lot of extra unneeded complexity, no? Or am I missing something here?

@jshipley

Copy link
Copy Markdown
Contributor

If there's a data component, I'd want to be able to use something like oritech:dubious_container[oritech:dubious_container_target=["minecraft:zombie","minecraft:enderman"]] or even just give it an arbitrary tag during stack creation (eg /give)

Would that work with this change?

@Hiiragi283

Copy link
Copy Markdown
Author

Hi, thanks for this PR. This looks mostly good, but why is the entity type tag not used directly in the item code, and is instead put into a data component that is then loaded in the item code? This sounds a lot of extra unneeded complexity, no? Or am I missing something here?

I used HolderSet because I designed it like other vanilla components. however, since there is a specific item class, as you mentioned, it might be fine to simply reference entity tag directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants