|
| 1 | +# Deep Drill Registration Event |
| 2 | + |
| 3 | +This event is a utility event to allow registering new materials and recipes mined by the |
| 4 | +[Bedrock Extractor](../recipe/machine/bedrock_extractor.md) also known as the Deep Drill. Because the deep drill mechanic depends on a |
| 5 | +recipe and a tag, this event handles both of these registrations at the same time. |
| 6 | + |
| 7 | +If you prefer registering both of these separately, check out the Bedrock Extractor recipe page and the |
| 8 | +[tag documentation](tags.md#resource-nodes). |
| 9 | + |
| 10 | +**It is a server event and reloadable!** |
| 11 | +Keep in mind that server events have to be located inside the `kubejs/server_scripts` folder. |
| 12 | + |
| 13 | +## Overview |
| 14 | + |
| 15 | +Oritech uses the tag `oritech:resource_nodes` to determine which blocks can be mined from by the Bedrock Extractor. The item result |
| 16 | +is determined by a recipe. This event allows you to register new resource nodes and recipes for the Bedrock Extractor at the same time. |
| 17 | + |
| 18 | +- access in a server script via: `EnderIOEvents.deepDrillRegistration` |
| 19 | +- functions |
| 20 | + - `add(...)` |
| 21 | + - description: registers the input block as resource node and adds the recipe for the Bedrock Extractor |
| 22 | + - parameters: |
| 23 | + - `inputBlock` |
| 24 | + - type: `Block` |
| 25 | + - required: yes |
| 26 | + - description: the block that should be mined as a resource node; this block will be tagged with `oritech:resource_nodes` automatically |
| 27 | + - `outputItem` |
| 28 | + - type: `ItemStack` |
| 29 | + - required: yes |
| 30 | + - description: the item that should be the result of mining the resource node; can include count |
| 31 | + - `time` |
| 32 | + - type: `Integer` |
| 33 | + - required: no |
| 34 | + - default: `60` |
| 35 | + - description: time in ticks for a single extraction operation; can mine multiple ores at once occasionally |
| 36 | + - `id` |
| 37 | + - type: `ResourceLocation` |
| 38 | + - required: yes |
| 39 | + - description: the recipe ID for the recipe; this must be unique |
| 40 | + |
| 41 | +## Event Listener |
| 42 | + |
| 43 | +To access the event, the first thing you need to do is to open an event listener for the `deepDrillRegistration` event in a server script. |
| 44 | + |
| 45 | +```js |
| 46 | +EnderIOEvents.deepDrillRegistration(event => { |
| 47 | + // ... |
| 48 | +}) |
| 49 | +``` |
| 50 | + |
| 51 | +After that, you can use the `add` function to register new resource nodes and recipes. |
| 52 | + |
| 53 | +## Example |
| 54 | + |
| 55 | +```js |
| 56 | +OritechEvents.soulCollection(event => { |
| 57 | + // registers the glass block as a resource node |
| 58 | + // adds a recipe that converts a glass block into a cobblestone |
| 59 | + // defaults to 60 ticks / 3 seconds |
| 60 | + event.add("glass", "cobblestone", "mymodpack:deep_drill/cobblestone") |
| 61 | + |
| 62 | + // registers the dirt block as a resource node |
| 63 | + // adds a recipe that converts a dirt block into 4 iron ingots |
| 64 | + // requires 100 ticks / 5 seconds |
| 65 | + event.add("dirt", "4x iron_ingot", 100, "mymodpack:deep_drill/iron_ingot") |
| 66 | +}) |
| 67 | +``` |
0 commit comments