Improved entity management for Dubious Container - #826
Conversation
|
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? |
|
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? |
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. |
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.ENERGYaccepts negative energy value.So I just replaced
Codec.INTwithExtraCodecs.NON_NEGATIVE_INTto 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.
Checklist: