Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentTweaker scripts not working in 1.18.2 #262

Open
Nevrai opened this issue Aug 4, 2022 · 2 comments
Open

ContentTweaker scripts not working in 1.18.2 #262

Nevrai opened this issue Aug 4, 2022 · 2 comments

Comments

@Nevrai
Copy link

Nevrai commented Aug 4, 2022

My two ContentTweaker scripts aren’t working in 1.18.2 (Forge).

Blocks script: https://pastebin.com/raw/HT2cXEFp
Items script: https://pastebin.com/raw/i3KbKY9C

Neither script will load, and I’m getting these syntax errors:
ContentTweaker errors

I’m sure I’m doing something wrong, but scripts with the same kind of syntax worked in 1.12.2, and the syntax is in accordance with the documentation I’m able to find on the ContentTweaker wiki. As far as I can tell, the scripts have proper syntax. I assume something changed in the 1.18.2 version in relation to syntax, but I can’t find up-to-date information.

crafttweaker.log: https://pastebin.com/raw/cmg8f6JZ

Versions

  • Minecraft: 1.18.2
  • ContentTweaker: 1.0.0+9 (latest)
  • CraftTweaker: 9.1.184 (latest) (also tested on 9.1.183 and 9.1.182)
  • Forge: 40.1.69 (latest) (also tested on 40.1.68)
@Nevrai
Copy link
Author

Nevrai commented Aug 4, 2022

I found documentation on 1.16 ContentTweaker which I used to make this:

new BlockBuilder(<blockmaterial:stone>)
    .build("kvikk_lunsj_ore");
    .withHarvestLevel(3);
    .withHardnessAndResistance(2.7);
    .withHarvestTool(<tooltype:pickaxe>);
	.setBlockSoundType(<soundtype:minecraft:stone>);
	.setDropHandler(function(drops, world, position, state, item){
    drops.clear();
    drops.add(<item:contenttweaker:kvikk_lunsj_piece>);
    drops.add(<item:contenttweaker:kvikk_lunsj_piece> % 30);
    drops.add(<item:contenttweaker:kvikk_lunsj> % 6);
    drops.add(<item:contenttweaker:kvikk_lunsj_six_pack> % 1);
    });

I’m not sure if this is right. It probably isn’t. I can’t find any documentation on how to add a loot table, so I don’t know how to make it drop what I want, since that part of the code above uses the 1.12.2 syntax.

I can’t figure out how to add food items either.

@jaredlll08
Copy link
Member

The Syntax is completely different in 1.18.

Use /ct examples to generate examples files that should help with what you want to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants