CraftTweaker

CraftTweaker

151M Downloads

loadedMods.items does not contain all items for a mod

clubpetey opened this issue ยท 3 comments

commented

Issue Description:

NOTE: I used AgriCraft in my testing, but confirmed this happens for several different mods.

I attempted to loop through the items of a mod using loadedMods.items however the list of items returned is not all the items as listed by NEI/JEI. Either the items were created after the code was executed -- perhaps in POSTINITIALIZATION, the items are specifically left out because they contain tags, or the code discovering items for a mod is incomplete.

What happens:

looping through items using loadedMods["agricraft"].items does not pickup items with a tag such as water_channel_normal. Complete name returned by /ct hand is:
<agricraft:water_channel_normal>.withTag({agri_material_meta: 8, agri_material: "chisel:planks-spruce"})

What you expected to happen:

Items array should contain all items of the mod. Including variants with tags, alternatively, items array should contain one entry of the item with the name having ":*" on the end so that it can be passed to other function that can operate on all meta variants of an item.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

https://pastebin.com/bjLeBkij

crafttweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

https://pastebin.com/3P5THt8b


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12.2
  • Forge: 2760
  • Crafttweaker: 4.1.10
  • Using a server: NO - single player
  • If yes, does the client have the exact same scripts?

Your most recent log file where the issue was present:

log provided above

commented

There is nothing that we can do if items aren't added at the correct time.

commented

I am able to change the recipe for the missing items. If recipe adjustment commands can run at POSTINITIALIZATION then is there a way to indicate that a regular script should run at POSTINITIALIZATION. This might fix the problem. Something like a pre-processor directive?

commented

No.