Jump to content

CrackedScreen

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by CrackedScreen

  1. Are there any workarounds for reducing potion duration inside of PotionAddedEvent? According to forge source code, durations can only be increased by update().
  2. 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.
  3. I need obfuscated names to use access transformers/reflection, but haven't found an up to date list anywhere.
  4. 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
  5. 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:
  6. 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.
  7. Registry class: I could try registering this outside of event bus in a non-static context.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  13. 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.
  14. This works, thanks for helping. Marking this thread as solved.
  15. In that case, are there any forge event handlers which allow me to do this or any existing examples where player arms are hidden?
  16. 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?
  17. Marking this thread as solved, seeing as how Forge doesn't seem to have a clean solution for this.
  18. 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.
  19. 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?
  20. 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:
  21. { "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.
  22. 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".
  23. { "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?
  24. 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?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.