No such symbol: mods
LokeYourC3PH opened this issue ยท 12 comments
As the other issue tracker, I have the same issue: I face the following error:
My script:
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index);
mods.initialinventory.InvHandler.addStartingItem(<item:simplyswords:iron_katana>, 1);
mods.initialinventory.InvHandler.addStartingItem(<item:azure-paxels:iron_paxel>, 2);
mods.initialinventory.InvHandler.addStartingItem(<item:chisel:chisel>, 5);
mods.initialinventory.InvHandler.addStartingItem(<item:rechiseled:chisel>, 6);
mods.initialinventory.InvHandler.addStartingItem(<item:simplemagnets:basicmagnet>, 7);
mods.initialinventory.InvHandler.addStartingItem(<item:travelersbackpack:standard>, 8);
mods.initialinventory.InvHandler.addStartingItem(<item:midashunger:golden_turtle_egg> * 64, 9);
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_boots>, 36); #Boots
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_leggings>, 37); #Legs
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_chestplate>, 38); #Body
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_helmet>, 39); #Head
My crafttweaker.log:
[13:35:34.834][INFO][CraftTweaker-Commands]: Item: <item:simplyswords:iron_katana>
[13:35:34.836][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:35:34.837][INFO][CraftTweaker-Commands]: - <tag:items:c:tools>
[13:35:34.837][INFO][CraftTweaker-Commands]: - <tag:items:simplyswords:swords>
[13:35:34.837][INFO][CraftTweaker-Commands]: - <tag:items:simplyswords:iron_gear>
[13:35:34.837][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:swords>
[13:35:34.837][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:breaks_decorated_pots>
[13:35:34.837][INFO][CraftTweaker-Commands]: - <tag:items:c:swords>
[13:35:34.837][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:tools>
[13:35:47.301][INFO][CraftTweaker-Commands]: Item: <item:azure-paxels:iron_paxel>
[13:35:47.301][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:cluster_max_harvestables>
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:breaks_decorated_pots>
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:shovels>
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:axes>
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:swords>
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:pickaxes>
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:hoes>
[13:35:47.301][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:tools>
[13:36:28.533][INFO][CraftTweaker-Commands]: Item: <item:chisel:chisel>
[13:36:49.083][INFO][CraftTweaker-Commands]: Item: <item:rechiseled:chisel>
[13:37:01.496][INFO][CraftTweaker-Commands]: Item: <item:simplemagnets:basicmagnet>
[13:37:01.496][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:37:01.496][INFO][CraftTweaker-Commands]: - <tag:items:trinkets:hand/ring>
[13:37:01.496][INFO][CraftTweaker-Commands]: - <tag:items:trinkets:offhand/ring>
[13:37:15.578][INFO][CraftTweaker-Commands]: Item: <item:travelersbackpack:standard>
[13:37:15.579][INFO][CraftTweaker-Commands]: Block: <block:travelersbackpack:standard>
[13:37:15.579][INFO][CraftTweaker-Commands]: BlockState: <blockstate:travelersbackpack:standard:facing=north>
[13:37:15.579][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:37:15.579][INFO][CraftTweaker-Commands]: - <tag:items:travelersbackpack:custom_travelers_backpack>
[13:37:15.579][INFO][CraftTweaker-Commands]: - <tag:items:trinkets:chest/back>
[13:37:28.479][INFO][CraftTweaker-Commands]: Item: <item:midashunger:golden_turtle_egg> * 64
[13:37:45.448][INFO][CraftTweaker-Commands]: Item: <item:minecraft:iron_helmet>
[13:37:45.449][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:scorched:headpiece>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:trimmable_armor>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:armor>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:c:armor>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:scorched:armor>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:helmets>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:c:helmets>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:c:armors/helmets>
[13:37:45.449][INFO][CraftTweaker-Commands]: - <tag:items:c:armors>
[13:37:59.178][INFO][CraftTweaker-Commands]: Item: <item:minecraft:iron_chestplate>
[13:37:59.178][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:c:armors/chestplates>
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:c:armors>
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:trimmable_armor>
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:scorched:armor>
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:c:chestplates>
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:c:armor>
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:chestplates>
[13:37:59.178][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:armor>
[13:38:09.348][INFO][CraftTweaker-Commands]: Item: <item:minecraft:iron_leggings>
[13:38:09.348][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:c:armors>
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:c:armors/leggings>
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:c:leggings>
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:trimmable_armor>
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:scorched:armor>
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:leggings>
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:c:armor>
[13:38:09.348][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:armor>
[13:38:16.344][INFO][CraftTweaker-Commands]: Item: <item:minecraft:iron_boots>
[13:38:16.344][INFO][CraftTweaker-Commands]: Item Tag Entries
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:c:boots>
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:boots>
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:c:armors>
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:c:armors/boots>
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:minecraft:trimmable_armor>
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:scorched:armor>
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:c:armor>
[13:38:16.344][INFO][CraftTweaker-Commands]: - <tag:items:bookshelf:armor>
[13:38:42.392][INFO][CraftTweaker-ZenCode]: Started loading scripts for loader 'tags'
[13:38:42.392][INFO][CraftTweaker-ZenCode]: Undoing previous actions
[13:38:42.410][INFO][CraftTweaker-ZenCode]: Compiling and executing scripts
[13:38:42.413][INFO][CraftTweaker-ZenCode]: Successfully initialized modules [crafttweaker, expansions]
[13:38:42.437][INFO][CraftTweaker-ZenCode]: Execution for loader 'tags' completed successfully
[13:38:45.269][INFO][CraftTweaker-ZenCode]: Started loading scripts for loader 'crafttweaker'
[13:38:45.269][INFO][CraftTweaker-ZenCode]: Undoing previous actions
[13:38:45.280][INFO][CraftTweaker-ZenCode]: Compiling and executing scripts
[13:38:45.348][INFO][CraftTweaker-ZenCode]: Successfully initialized modules [mods, crafttweaker, expansions]
[13:38:45.348][INFO][CraftTweaker-ZenCode]: Loading file 'InitialInventory.zs' with priority 0
[13:38:45.348][INFO][CraftTweaker-ZenCode]: Loading file 'Remove_Recipes.zs' with priority 0
[13:38:45.348][INFO][CraftTweaker-ZenCode]: Loading file 'TechReborn.zs' with priority 0
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:2:0: InitialInventory.zs:2:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:3:0: InitialInventory.zs:3:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:4:0: InitialInventory.zs:4:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:5:0: InitialInventory.zs:5:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:6:0: InitialInventory.zs:6:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:7:0: InitialInventory.zs:7:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:8:0: InitialInventory.zs:8:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:9:0: InitialInventory.zs:9:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:10:0: InitialInventory.zs:10:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:11:0: InitialInventory.zs:11:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker-ZenCode]: InitialInventory.zs:12:0: InitialInventory.zs:12:0: No matching method found for addStartingItem:
4 parameters expected but 2 given.
4 parameters expected but 2 given.
[13:38:45.355][ERROR][CraftTweaker]: Scripts are invalid!
[13:38:45.355][INFO][CraftTweaker-ZenCode]: Execution for loader 'crafttweaker' completed successfully
Unlike the other guy's thread, I hope this helps you figure out what causes this :)
This is for Minecraft 1.20.1 Fabric, version "Fabric-1.20.1-11.0.2".
Upload the full crafttweaker.log, and the latest.log file to gist.github.com please
I'm not sure where you got the screenshot that is complaining about not being able to find "mods", as that is not printed anywhere in either of your log files.
The actual error is that you are missing the "key" part of the method call
https://docs.blamejared.com/1.20.1/en/mods/initialinventory/InvHandler#addStartingItem
You have:
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index);
mods.initialinventory.InvHandler.addStartingItem(<item:simplyswords:iron_katana>, 1);
mods.initialinventory.InvHandler.addStartingItem(<item:azure-paxels:iron_paxel>, 2);
mods.initialinventory.InvHandler.addStartingItem(<item:chisel:chisel>, 5);
mods.initialinventory.InvHandler.addStartingItem(<item:rechiseled:chisel>, 6);
mods.initialinventory.InvHandler.addStartingItem(<item:simplemagnets:basicmagnet>, 7);
mods.initialinventory.InvHandler.addStartingItem(<item:travelersbackpack:standard>, 8);
mods.initialinventory.InvHandler.addStartingItem(<item:midashunger:golden_turtle_egg> * 64, 9);
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_boots>, 36); #Boots
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_leggings>, 37); #Legs
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_chestplate>, 38); #Body
mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_helmet>, 39); #Head
but really it should be:
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index);
mods.initialinventory.InvHandler.addStartingItem("key", <item:simplyswords:iron_katana>, 1);
mods.initialinventory.InvHandler.addStartingItem("key", <item:azure-paxels:iron_paxel>, 2);
mods.initialinventory.InvHandler.addStartingItem("key", <item:chisel:chisel>, 5);
mods.initialinventory.InvHandler.addStartingItem("key", <item:rechiseled:chisel>, 6);
mods.initialinventory.InvHandler.addStartingItem("key", <item:simplemagnets:basicmagnet>, 7);
mods.initialinventory.InvHandler.addStartingItem("key", <item:travelersbackpack:standard>, 8);
mods.initialinventory.InvHandler.addStartingItem("key", <item:midashunger:golden_turtle_egg> * 64, 9);
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_boots>, 36); // Boots
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_leggings>, 37); // Legs
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_chestplate>, 38); // Body
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_helmet>, 39); // Head
the "key" can be anything, you can read more about it in the linked method.
I also changed your comments to use //
as using #
may have some unintended side effects with preprocessors.
I'm not sure where you got the screenshot that is complaining about not being able to find "mods", as that is not printed anywhere in either of your log files.
The actual error is that you are missing the "key" part of the method call https://docs.blamejared.com/1.20.1/en/mods/initialinventory/InvHandler#addStartingItem
You have:
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index); mods.initialinventory.InvHandler.addStartingItem(<item:simplyswords:iron_katana>, 1); mods.initialinventory.InvHandler.addStartingItem(<item:azure-paxels:iron_paxel>, 2); mods.initialinventory.InvHandler.addStartingItem(<item:chisel:chisel>, 5); mods.initialinventory.InvHandler.addStartingItem(<item:rechiseled:chisel>, 6); mods.initialinventory.InvHandler.addStartingItem(<item:simplemagnets:basicmagnet>, 7); mods.initialinventory.InvHandler.addStartingItem(<item:travelersbackpack:standard>, 8); mods.initialinventory.InvHandler.addStartingItem(<item:midashunger:golden_turtle_egg> * 64, 9); mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_boots>, 36); #Boots mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_leggings>, 37); #Legs mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_chestplate>, 38); #Body mods.initialinventory.InvHandler.addStartingItem(<item:minecraft:iron_helmet>, 39); #Headbut really it should be:
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index); mods.initialinventory.InvHandler.addStartingItem("key", <item:simplyswords:iron_katana>, 1); mods.initialinventory.InvHandler.addStartingItem("key", <item:azure-paxels:iron_paxel>, 2); mods.initialinventory.InvHandler.addStartingItem("key", <item:chisel:chisel>, 5); mods.initialinventory.InvHandler.addStartingItem("key", <item:rechiseled:chisel>, 6); mods.initialinventory.InvHandler.addStartingItem("key", <item:simplemagnets:basicmagnet>, 7); mods.initialinventory.InvHandler.addStartingItem("key", <item:travelersbackpack:standard>, 8); mods.initialinventory.InvHandler.addStartingItem("key", <item:midashunger:golden_turtle_egg> * 64, 9); mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_boots>, 36); // Boots mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_leggings>, 37); // Legs mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_chestplate>, 38); // Body mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_helmet>, 39); // Headthe "key" can be anything, you can read more about it in the linked method.
I also changed your comments to use
//
as using#
may have some unintended side effects with preprocessors.
Well the screenshot is what I see when joining my server with this. And I see, missing the "Key" entry was the problem but apparently it is necessary, then? It is not stated anywhere that it is, and as a matter of fact, in all examples given here (also by you), the "Key" is omitted. The comments with "#" are also from your example from the "Armour Slots" thread, which is where I got that from. I'll try the suggestions first :)
Alright so, now it gives me the items, but it still on the client shows that message in the screenshot, even though the items are handed to the player. What?
Are you connecting to a server?
The client does need the InitialInventory mod installed, or you can doL
#onlyif side server
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index);
mods.initialinventory.InvHandler.addStartingItem("key", <item:simplyswords:iron_katana>, 1);
mods.initialinventory.InvHandler.addStartingItem("key", <item:azure-paxels:iron_paxel>, 2);
mods.initialinventory.InvHandler.addStartingItem("key", <item:chisel:chisel>, 5);
mods.initialinventory.InvHandler.addStartingItem("key", <item:rechiseled:chisel>, 6);
mods.initialinventory.InvHandler.addStartingItem("key", <item:simplemagnets:basicmagnet>, 7);
mods.initialinventory.InvHandler.addStartingItem("key", <item:travelersbackpack:standard>, 8);
mods.initialinventory.InvHandler.addStartingItem("key", <item:midashunger:golden_turtle_egg> * 64, 9);
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_boots>, 36); // Boots
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_leggings>, 37); // Legs
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_chestplate>, 38); // Body
mods.initialinventory.InvHandler.addStartingItem("key", <item:minecraft:iron_helmet>, 39); // Head
#endif
Which will make that section of the script only load on the server.
It is recommended to install the mod on both sides however.
OHHHHHHHH ok well that makes sense, yeah the client doesn't have the mod installed because I saw no reason for something like this needing to be installed client side as well, as all the server is supposed to do is give the player items, that's it. Okay well that is good to know, I will implement the changes you've made, thank you!
Hmm, sorry to re-open it, but it seems as if the change does not work, it still nags on the client side. This is my script:
#onlyif side server
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index);
mods.initialinventory.InvHandler.addStartingItem("Katana", <item:simplyswords:iron_katana>, 1);
mods.initialinventory.InvHandler.addStartingItem("Paxel", <item:azure-paxels:iron_paxel>, 2);
mods.initialinventory.InvHandler.addStartingItem("Chisel", <item:chisel:chisel>, 5);
mods.initialinventory.InvHandler.addStartingItem("ReChisel", <item:rechiseled:chisel>, 6);
mods.initialinventory.InvHandler.addStartingItem("Magnet", <item:simplemagnets:basicmagnet>, 7);
mods.initialinventory.InvHandler.addStartingItem("Backpack", <item:travelersbackpack:standard>, 8);
mods.initialinventory.InvHandler.addStartingItem("Eggs", <item:midashunger:golden_turtle_egg> * 64, 9);
mods.initialinventory.InvHandler.addStartingItem("Boots", <item:minecraft:iron_boots>, 36); // Boots
mods.initialinventory.InvHandler.addStartingItem("Leggings", <item:minecraft:iron_leggings>, 37); // Legs
mods.initialinventory.InvHandler.addStartingItem("Chestplate", <item:minecraft:iron_chestplate>, 38); // Body
mods.initialinventory.InvHandler.addStartingItem("Helmet", <item:minecraft:iron_helmet>, 39); // Head
#endif
Try this
#onlyif side dedicated_server
//mods.initialinventory.InvHandler.addStartingItem(String key, IItemStack item, Optional int index);
mods.initialinventory.InvHandler.addStartingItem("Katana", <item:simplyswords:iron_katana>, 1);
mods.initialinventory.InvHandler.addStartingItem("Paxel", <item:azure-paxels:iron_paxel>, 2);
mods.initialinventory.InvHandler.addStartingItem("Chisel", <item:chisel:chisel>, 5);
mods.initialinventory.InvHandler.addStartingItem("ReChisel", <item:rechiseled:chisel>, 6);
mods.initialinventory.InvHandler.addStartingItem("Magnet", <item:simplemagnets:basicmagnet>, 7);
mods.initialinventory.InvHandler.addStartingItem("Backpack", <item:travelersbackpack:standard>, 8);
mods.initialinventory.InvHandler.addStartingItem("Eggs", <item:midashunger:golden_turtle_egg> * 64, 9);
mods.initialinventory.InvHandler.addStartingItem("Boots", <item:minecraft:iron_boots>, 36); // Boots
mods.initialinventory.InvHandler.addStartingItem("Leggings", <item:minecraft:iron_leggings>, 37); // Legs
mods.initialinventory.InvHandler.addStartingItem("Chestplate", <item:minecraft:iron_chestplate>, 38); // Body
mods.initialinventory.InvHandler.addStartingItem("Helmet", <item:minecraft:iron_helmet>, 39); // Head
#endif
If that doesn't work, you're going to need to install the mod on the client.
#onlyif side dedicated_server
I will try that. And if that is the case, I will just delete the mod because then it would be sorta useless if a mere script/plugin or command block can do that, but this mod somehow cannot without nagging players ๐ข