CraftTweaker

CraftTweaker

151M Downloads

Array's/List's not working

LookAMb opened this issue · 2 comments

commented

Issue description

I have scoured Google for anything to do with "Crafttweaker arrays" and can't find anything besides the official documentation, which doesn't seem to provide functional documentation. The only array I was able to get to work was the array using the type "string[]". I am trying to use the "IItemstack[]" type with no success.
Here's an example of the error message I receive after doing "/reload":
https://pastebin.com/dwVkMPy1

Here's an example of a functional array:
https://pastebin.com/X7q2s0An

Here's an example of what I'm trying to do based on the documentation:
https://pastebin.com/wKsMjLu1

Steps to reproduce

To reproduce this issue:

  1. Paste the code from the [https://pastebin.com/wKsMjLu1](Array using type IItemstack) pastebin into a ZenScript file within "scripts\recipes".
  2. Proceed to a single-player world with cheats enabled.
  3. Type /reload, and wait.
  4. You'll get an error reading similar to the following: [https://pastebin.com/dwVkMPy1](Error after running IItemstack array)

Script used

https://pastebin.com/wKsMjLu1

The crafttweaker.log file

https://pastebin.com/dwVkMPy1

Minecraft version

1.19

Modloader

Forge

Modloader version

43.2.6

CraftTweaker version

10.1.38

Other relevant information

This is within a mod pack I am making, but no other mods interfere with Craftweaker such as any add-ons, of which I have none.

The latest.log file

Log file is too big.

commented

You need to add the import for IItemStack, otherwise the engine doesn't know what class you're referencing.

https://docs.blamejared.com/1.19/en/vanilla/api/item/IItemStack#importing-the-class

Just add

import crafttweaker.api.item.IItemStack;

to the top of your script file

commented