Scavenge is a mod that allows you to apply custom RightClick/LeftClick behaviors
to any Block. On top of that you can add LootPools to these behaviors that are dropped when the conditions are met. These things are loaded from JsonFiles and act closely to a Scripting language.
On top of that you can add certain unque features/conditions when rightclicking these blocks.
For example:
- Player has to sneak,
- Player has to have a Diamond in his hands
- The block is unbreakable
- The block disapears after 5 uses
- etc.
1.10.2-1.12.2 Documentation: ClickMe
Anything below this is the 1.16 Documentation:
If you want a good tutorial on How to make Scavenge Scripts.
Xaikii had written some examples and tutorials on how Scripts work. ClickMe
Ported Addon to 1.16:
Documentation is now part of the mod. How to view it:
Set "printExamples" to true and the documentation will be generated in the Minecraft Folder in the "scavenge_doc" folder.
The documentation is sorted by Plugin -> TypeOfProperty -> PropertyName.
To simplify the finding of the Documentation. Also since its autogenerated. It can only get lost if all Scavenge Jars get lost.
Also If you install plugins they will also generate documentation automatically with it. And it would be sorted by the addon Plugins.
1.16.5 version also can now Dump Loaded Scripts. They will look a tiny bit different because it depends on how the Property is implemented but it will make debugging a lot easier. If something didn't get added in the script the dump can not see it either because the Mod dumps the parsed scripts.
This is also a config entry. Note: This also works with Multiplayer.
How to add a Scavenge Script:
Scavenge now works with Resource Packs. It will automatically load all files that are in the "datapacks/DATAPACK_NAME/data/DOMAIN/scavenge_scripts" folder.
And will automatically reload them on resource packs reload. They will be automatically synced over to the client so no more "server->client" manual Syncing. Its done automatically.
Since the tool has a JEI plugin i had to install a JEI hack that reloads JEI 1 tick after scripts got reloaded because JEI does not support any mod that has recipe/data autosyncing. (This can get fast into the 2-3 digit reload range if jei does not fix this problem)
What has Changed outside of ResourcePacks now:
- Effects are now only executed on server, while conditions are tested both on server & client. So there can be desyncs if you store data unsynchronized.
- Math Operations/Conditions are now a lot more enforced then before because more flexibility even if the code is bigger.
- Error Messages can now be directly added into Conditions so no longer the separate section with messages. And for effects there is a Message Effect.
- Conditions can by default now be inverted. (Addons can not be guaranteed to support that)
- Scavenge now uses Vanilla LootPools and you can just link them to the lootpool. It will try to show them in JEI but accuracy for more random/complex loot may not look as good.
- Math Operations/Conditions have now bit support.
- Examples for everything are generated. (Again Addons can not guaranteed to support that)
This is a forge mod, right?
Could you please add / set the modloader tag "forge" to your versions / releases?
Thank you! :-)
In reply to EvilCodes:
For the following versions that will be a thing. But lets say I was burned trying that. Last time Curseforge corrupted a release of Unique Enchantments and some really bad things happen when I wanted to add that..
But here is the rule of thumb, since they added this: "If no Modloader Tag is there, assume forge" because you cant apply retroactively to all mods that never had them.
Excuse me, I would like to know if there is a way in this mod after pressing on a specific block set its spawn point
I want the waystones to look something like "bonfires" in minecraft
In reply to mebeije223:
You can run commands through a block click so yes this is possible. Anything that isn't provided by scavenge itself, you be most likely able to do with commands triggered by the action. (Yes you get Admin Rights when doing so)
Hello, thanks for this mod. Question though, when using Consume Block to replace one block with another is there a way to set the orientation of the new block? I'm trying to replicate PrimalCore's Workblades and I keep getting stairs facing the wrong way.
In reply to GarninTheGreat:
In case anyone else comes across this difficulty I made it work by using the "use_command" property and the "Setblock" command from vanilla. This command allows you to set the block state of the block you are replacing a block with. My use case was "arguments": "~ ~ ~ primal:ladder_block_endstone facing=north". Hope this helps someone.
In reply to GarninTheGreat:
Always appreciate a posted solution, +1 karma my friend. Best.
I'm trying to put together a script that gives you bark when you right click a tree with a knife. Reading through all the documentation, it should work perfectly. But for some reason it's producing an error instead.
Script:
https://pastebin.com/11pi0hTP
In reply to JamesDaMaker:
Read the error it says: At line 24 there is a new JsonObject expected yet there isn't one. Because you placed a comma at line 23....
In reply to Speiger:
thank you, I thought the error was stating that it still needed a string. This fixed it!
Edit: didn't fix it, now it crashes. And all I did was remove the comma
here's the log: https://pastebin.com/i4j6Wrkc
In reply to JamesDaMaker:
You are missing a "name" variable from what I was able to find.
In reply to Speiger:
Alas, that was the issue. I didn't add the first "name" variable (which I assume is naming the recipe for JEI and recipe registration) and that caused more issues than just a comma. Thank you for your help!
Im trying to work with the require_dimension property for 1.12.2 again, which I never got to work and I still cant seem to get it. Here is the script I am using this time, which I have confirmed shows no errors and works fine without the property.
Please describe in detail how to write a nbtfiles,and a general example. This makes it difficult for zero-based players to understand, thank you
In reply to mc_smauingf:
NBTFiles in 1.10-1.12 minecraft are written like this:
id=PasteTheNBTHereHowYouWouldWriteItIntoAMinecraftCommand.
id2=SNBT (Thats the term)
id3={Invulnerable:1,<wbr />PersistenceRequired:1,<wbr />Silent:1,<wbr />NoAI:1,<wbr />CanPickUpLoot:1b,<wbr />CanBreakDoors:1b,<wbr />Motion:[0.3,<wbr />0.0,<wbr />0.0],<wbr />CustomName:Test}
Hi, Speiger!
My scavenge files aren't working when I'm joined to a server. They are on both Client and Server.
Am I doing something wrong, or should I make a bug report?
In reply to teksturepako:
We can try fixing your issue if possible. You can write here or in a issue section, whatever desire.
Now 2 questions: Did you link the scripts in the config file? (Both server & client)
In reply to Speiger:
Thanks for a quick reply.
The answer is yes I included the configs on both server & client.
But I will try it once again and send the logs. Also, here they are, on GitHub: https://github.com/juraj-hrivnak/Underdog/tree/slave/config/scavenge
In reply to teksturepako:
This looks fine. And in singleplayer all scripts load. I wonder did the loading causes errors? There are commands that would print errors if they were happening.
In reply to Speiger:
Yeah, no errors in the chat.