Everything posted by CrackedScreen
-
[1.18.2] Can't reduce potion duration with effect.update()
Are there any workarounds for reducing potion duration inside of PotionAddedEvent? According to forge source code, durations can only be increased by update().
-
[1.18.2] How to get SRG/obfuscated names of fields/methods
Thanks, marking this as solved.
-
[1.18.2] How to get SRG/obfuscated names of fields/methods
Do I need to switch between using unobfuscated names and SRG names when running the mod in dev and build environments? I plan on using this for reflection since I need access to private/protected fields and methods.
-
[1.18.2] How to get SRG/obfuscated names of fields/methods
I need obfuscated names to use access transformers/reflection, but haven't found an up to date list anywhere.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
Managed to fix this by creating different conditions for each recipe and reusing the same serializer. Apparently it isn't possible to return different values with the same condition, and the "null issue" is forge working as intended according to here: https://github.com/P3pp3rF1y/Reliquary/issues/529
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
The test value that I'm using already has a default value set: Will look into using booleans, but I may have tried this + reloading before with no success using something similar:
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
Adding modid = MOD_ID to my event bus subscriber didn't have any effect. The serializer only has the null issue when the config value is set to false for some reason, if I return true/false directly in the condition class or leave the config value as true there aren't any issues with loading/blocking the recipe.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
Registry class: I could try registering this outside of event bus in a non-static context.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
You'll have to elaborate on why this is the case since I don't see any immediate issues. I created the condition almost the exact same way the builtin forge conditions are. Edit: The recipes are disabled if the config value is set to false, but only after manually reloading. Will need a fix for the serializer issue and best practices for forcing a reload upon entering a world if the serializer fix doesn't correct this behavior.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
I've already tried pulling the value directly from configs, this does not change the result. The recipes aren't being loaded as the serializer is returning null after using /reload, the problem is likely the read() method but I'm not sure what it should return since the examples provided by forge return a new condition with constructor. Would also prefer to reload datapacks from code whenever the world/server is loaded, if possible.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
The register event works fine after setting the method to static, though now it seems that changing the config file values inside of the save folder doesn't have any effect on whether the recipe is active or not. Code is still same as above.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
Used the following to create the recipe: Condition/Serializer class: Registered the serializer class in RegistryEvents class: Currently getting an "Unknown condition type" error when using the runData task which likely means the condition wasn't registered correctly, but don't know how this is the case.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
Late reply, but tried implementing ICondition and copying some code over from ModLoadedCondition: Getting an error for including the test() method since it is marked as deprecated, but forge still requires it to be implemented. Using Forge 1.18.2-40.1.51, if I'm missing anything let me know. EDIT: The mod will still compile and run fine since this isn't actually an error, but will need to know how to pass existing datagen recipes through the serializer since forge does not come with any functional examples by itself. Would still appreciate an answer on how to get rid of the deprecated method in case I am missing something obvious.
-
[1.18.2] [SOLVED] Disable crafting recipes from config files
I'm trying to disable crafting recipes based on config file values. Currently using datagen for crafting recipes, and ICondition seems to have changed compared to the older IConditionFactory.
-
[1.18.2] [SOLVED] Hide shield model while item is in use
This works, thanks for helping. Marking this thread as solved.
-
[1.18.2] [SOLVED] Hide shield model while item is in use
In that case, are there any forge event handlers which allow me to do this or any existing examples where player arms are hidden?
-
[1.18.2] [SOLVED] Hide shield model while item is in use
Certain actions such as reloading the crossbow or pulling the bowstring hide the shield model. Where is the implementation for this, and what's the best way to use it if possible?
-
[1.18.2] [SOLVED] Modify incoming potion effects in Event handler
Marking this thread as solved, seeing as how Forge doesn't seem to have a clean solution for this.
-
[1.18.2] [SOLVED] Modify incoming potion effects in Event handler
Is this referring to separation of drank/splashed potions? I was asking about moving the entire implementation where all the needed information is accessible. If possible, I'd prefer to avoid doing something drastic like overriding/extending entity classes.
-
[1.18.2] [SOLVED] Modify incoming potion effects in Event handler
Adding a Tag to the player and removing it after the new effect is applied, then checking for it at the beginning of the event handler prevents the crash from occurring. I still need a way to check if the potion was applied through drinking/splash effect, I think getPotionSource() is supposed to handle this but it isn't part of PotionApplicableEvent. Are there any cleaner implementations for this aside from using event handler?
-
[1.18.2] [SOLVED] Modify incoming potion effects in Event handler
Denying a PotionApplicable event and attempting to apply a "replacement" potion with a weaker effect/duration causes a ticking player entity crash, likely because it is triggering the event handler infinitely. Is there any way to modify an incoming potion effect, as well as determine whether the potion was applied through drinking/splash? Code: Crash log:
-
[1.18.2] [SOLVED] Adding modded items to existing vanilla loot tables
{ "type": "loot_test:mod_loot", "conditions": [ { "condition": "minecraft:alternative", "terms": [ { "condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/ruined_portal" }, { "condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/nether_bridge" } ] } ], "min": 1, "max": 3, "chance": 0.5 } This works. Marking the thread as solved.
-
[1.18.2] [SOLVED] Adding modded items to existing vanilla loot tables
I cannot swap the type to minecraft:alternatives since the type field is used by the loot table serializer. If you have an example of an OR condition I could use for the json in my previous post that would work best. I'm specifically looking to change the condition so that loot will be added to multiple loot chest types instead of only "ruined_portal".
-
[1.18.2] [SOLVED] Adding modded items to existing vanilla loot tables
{ "type": "loot_test:mod_loot", "conditions": [ { "condition": "forge:loot_table_id", "loot_table_id": "minecraft:chests/ruined_portal" } ], "min": 1, "max": 3, "chance": 0.5 } Do loot table files currently support multiple conditions (such as adding modded loot in ruined_portal and nether_bridge loot) or will a new file need to be created and serialized for this?
-
[1.18.2] [SOLVED] Adding modded items to existing vanilla loot tables
Are there any recommended built in functions for modifying an item's loot chance/itemstack size inside of doApply() or is this something I should handle with a random number generator?
IPS spam blocked by CleanTalk.