|This Article is up to date with Custom Stuff 2|
For example, if you wanted to create a shovel that could chop down trees you could add the following line to the item's .js file:
effectiveBlocks = "17";
Where "17" is the block ID of logs.
If you want to add multiple blocks to this attribute, separate them with a comma as so:
effectiveBlocks = "17,5,53,58,63,64,65,125,126,134,135,136";
If a block has metadata values, and you only want your tool to be able to quickly cut through one of them, you can specify metadata values like so:
effectiveBlocks = "17:2"
This tool will only cut quickly through Birch Logs, but not through any other type. Again, toolClass not withstanding.
When creating custom Tools, it's important to designate which sort of blocks the tool can break efficiently. The efficinencyblocks attribute does this. You can add this attribute to your item, designating as many blocks, block types, or other variables as you so desire.
This will make your tool quickly break any sort of block, with respect to that block's hardness of course.
There are several words that can be added to this attribute that have pre-determined effects and behave pretty much as one would expect them to. They are:
- "all" - Tool cuts through every block quickly
- "none" - Tool doesn't break any blocks quickly
- "pickaxe" - As a vanilla pickaxe
- "shovel" - As a vanilla shovel
- "axe" - As a vanilla axe
In addition to this, you can specify individual block numbers by putting their IDs into this line, separated by commas. You can mix and match individual blocks and the above keywords as you see fit to create something unique.
For example, say we want to create an all-purpose axe that breaks stone as easily as it chops wood, and can break obsidian (blockID #49) quickly. We would add the following line to the .item file:
efficiencyblocks="pickaxe, axe, 49";
Important - Presently, values set in the efficiencyblocks attribute will only work correctly if they are also set as values for the harvestblocks attribute.