LootTweaker Help
HerleyJLancaster opened this issue ยท 16 comments
(Original issue)
Can't add/remove loot with loottweaker
To reproduce my fail: https://pastebin.com/fgvCSdvu
Wanted to add tconstruct arrows/gear and remove vanilla arrows/gear and add lootingEnchantBonus
Version Info (Exact versions only):
- LootTweaker: 0.1.5+MC1.12.2
- CraftTweaker/Minetweaker: Crafttweaker 4.1.20 Forge: 14.23.5.2847
- Minecraft: 1.12.2
- Tconstruct: 2.13.0.171
Working script to add/remove loot for this issue: https://hastebin.com/epukuvikov.cs
Version Info (Exact versions only):
- LootTweaker: 0.1.5+MC1.12.2
- CraftTweaker/Minetweaker: Crafttweaker 4.1.20 Forge: 14.23.5.2847
- Minecraft: 1.12.2
- Tconstruct: 2.13.0.171
I was having issues creating a script for loottweaker and I was unable to join Daomephsta's Discord due to account issues and the 404 error, so he took time to explain everything i was confused about here, on github.
and if i do need discord i would need links that actually work as it always gives me the 404 error when i try to join Daomephsta's discord for help.
and if i do need discord i would need links that actually work as it always gives me the 404 error when i try to join Daomephsta's discord for help.
The link works for me, no idea why it's 404ing for you.
I find it odd though, that a user named Harleyjlancaster joined my Discord 2 days ago, and left today. That not you?
You don't need Discord, but I'd prefer it. You've misunderstood a lot about ZenScript and LootTweaker, so I think a realtime conversation will be easier for both of us.
Ok, so it seems Discord doesn't work for you. If you'd told me that at the start I would have helped you through GitHub immediately.
The script you've linked doesn't use LootTweaker. It imports LootTweaker classes, but it doesn't use them at all. Instead it uses CraftTweaker's entity drops API.
IterationFunk's video covers both, as I note when I link to it in the LootTweaker docs.
If you want to use the LootTweaker API, I can help you with that here.
If you want to use CraftTweaker's entity drops API, I wouldn't usually help with that here, but I'll make an exception in this case.
So, which API do you want to use?
loottweaker would be perfect. i would like to adjust the stray loottable so it drops TConstruct arrows and bows instead of vanilla arrows and bows
loottweaker would be perfect. i would like to adjust the stray loottable so it drops TConstruct arrows and bows instead of vanilla arrows and bows
Your original script was halfway there, so we'll start with that.
The issues with that are as follows:
- Every line of ZenScript must end with a ; (semicolon). Several lines of that script don't, that's what the syntax error was about.
- Method calls in ZenScript look like object.method(arg1, arg2 etc.) or class.method(arg1, arg2 etc.). Several of the method calls in that script are missing their parentheses.
LootPool#removeEntry()
takes a string, not an IItemStack. It removes entries byentryName
, not by the itemstack they generate.LootPool#addEntry()
does not exist, you probably meantLootPool#addItemEntry()
.- Line 9 attempts to add an entry with a weight of 0, which means it would never generate.
- Line 10 attempts to add an entry without specifying a weight.
- Added Semicolons
- changed addEntry to addItemEntry
- Added Weight
i want stray to drop 0-2 arrows and have the chance to drop 1 tconstruct bow. i copied the items straight from Crafttweaker log: https://pastebin.com/w9QQxZYy
edited script: https://pastebin.com/2DwxxDrN
- What do i change LootPool#removeEntry With to get rid of the IItemStack instead of a string
-The parenthesis are proving difficult for me and i don't want to just throw them in
Added Weight
LootTweaker methods take the weight as a separate parameter, you don't use the %
like with CraftTweaker's entity drops API. Check the Adding Loot tutorial for a walkthrough and example.
What do i change LootPool#removeEntry With to get rid of the IItemStack instead of a string
Follow the Removing Loot tutorial from the docs.
The parenthesis are proving difficult for me and i don't want to just throw them in
They're fine, you've put them around the argument list, like you're supposed to.
i understand the weight now
Still not right. You copy pasted the min & max rolls & bonus rolls from the addPool() example. Read the tutorial.
am now only getting method available but none match for line 11
Because you're still calling removeEntry wrong. Follow the Removing Loot tutorial, as I told you earlier.
-
I have been able to differentiate the roll chance(1, 1, 0, 0) and weight is what you put at the end to make the item spawn, 1 being lowest rate and 5 being highest
-
I made a working script to add/remove loot: https://hastebin.com/epukuvikov.cs
Q: How do make the lootingEnchantBonus work?
A:
Q: I assume that In order to remove dungeon loot, i.e. simple dungeon or stronghold library, I would simply need to change the path to Minecraft: chests: simple_dungeon, correct?
A:
Q: Is there a way to completely replace randomly dropped armor and weapons, for example the strays vanilla bow with a TConstruct shortbow?
A:
Q: Can I change the armor entities spawn with, for example instead of a zombie spawning with full vanilla armor, have it spawn with TConstruct iron armor from the ConArm add-on?
P.S: If it's alright can i copy you messages and have you delete them when your done helping me so i can edit this and make a tutorial
can i copy you messages and have you delete them when your done helping me so i can edit this and make a tutorial
No, that would be a poor tutorial. It would be highly specific to the problems you had. Please stop replacing your existing responses with new content, or deleting them. It makes this issue difficult for me to follow, and even harder to follow for anyone who comes across it in the future.
It would be far more helpful if you made a clear list of what was confusing about the CraftTweaker docs on ZenScript and submitted that to the CraftTweaker team, then did the same for the LootTweaker docs on loot tweaking and submitted that to me. User feedback is essential to improvement of documentation.
-
I have been able to differentiate the roll chance(1, 1, 0, 0) and weight is what you put at the end to make the item spawn, 1 being lowest rate and 5 being highest
-
I made a working script to add/remove loot: https://hastebin.com/epukuvikov.cs
Q: How do make the lootingEnchantBonus work?
A:
Q: I assume that In order to remove dungeon loot, i.e. simple dungeon or stronghold library, I would simply need to change the path to Minecraft: chests: simple_dungeon, correct?
A:
Q: Is there a way to completely replace randomly dropped armor and weapons, for example the strays vanilla bow with a TConstruct shortbow?
A:
Q: Can I change the armor entities spawn with, for example instead of a zombie spawning with full vanilla armor, have it spawn with TConstruct iron armor from the ConArm add-on?
A:
I see the new issue you opened on the new user experience. i returned my messages to the original text.
1 being lowest rate and 5 being highest
That's not correct. Go read the Adding Loot tutorial again, it explains weight.
I assume that In order to remove dungeon loot, i.e. simple dungeon or stronghold library, I would simply need to change the path to Minecraft: chests: simple_dungeon, correct?
Removing loot from one loot table is just like removing loot from any other loot table..
How do make the lootingEnchantBonus work
Check the docs, there's documentation for every type and its methods under the ZenScript Types heading.
Can I change the armor entities spawn with, for example instead of a zombie spawning with full vanilla armor, have it spawn with TConstruct iron armor from the ConArm add-on?
That's not a loot table thing, so no. Try https://www.curseforge.com/minecraft/mc-mods/armoreablemobs .
For the weight i set it to default 1 for an even amount and thats where i wanted it and my script works perfectly but I'm confused about the lootingEnchantBonus. the function page explains each function. i know i need to import the function to my script, but i don't know where to put the function itself on said script.