You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a new dialogue scene to be used within your add-on. This function is only available if your project target version is at least "1.17.40"
99
102
103
+
-`lootTable(lootTable: any): string`
104
+
Returns a string that points to your defined loot table
105
+
106
+
-`tradeTable(tradeTable: any): string`
107
+
Returns a string that points to your defined trade table
108
+
109
+
-`spawnRule(spawnRule: any): void`
110
+
Creates a new spawn rule file for entities that use the custom component
111
+
100
112
#### Item
101
113
102
114
```ts
@@ -131,6 +143,8 @@ interface TemplateContext {
131
143
condition?:string|false
132
144
) =>void
133
145
}
146
+
lootTable: (lootTable:any) =>string
147
+
recipe: (recipe:any) =>void
134
148
}
135
149
```
136
150
@@ -148,6 +162,12 @@ The `player` object gives access to these functions:
148
162
-`create(template: any, location?: string): void`
149
163
Allows you to create data inside of the player. `template` should be a JavaScript object of the data to merge into the player behavior file at the given `location`. `location` should be a path separated by `'/'` to where you want the `template` to be created. For example: `minecraft:entity/description`. The default merge behaviour can optionally be overridden with `operation` which should be a function that takes default merge function `deepMerge`, the data at `location` (`oldData`) and the new data being merged in (`newData`). It should return the result of the custom merge. For example: `(deepMerge, oldData, newData) => newData` will overwrite the data at `location`.
150
164
165
+
-`lootTable(lootTable: any): string`
166
+
Returns a string that points to your defined loot table
167
+
168
+
-`recipe(recipe: any): void`
169
+
Creates a new recipe for items that use the custom component
170
+
151
171
#### Block
152
172
153
173
```ts
@@ -168,6 +188,8 @@ interface TemplateContext {
168
188
projectNamespace:string
169
189
onActivated: (eventResponse:any) =>void
170
190
onDeactivated: (eventResponse:any) =>void
191
+
lootTable: (lootTable:any) =>string
192
+
recipe: (recipe:any) =>void
171
193
}
172
194
```
173
195
@@ -180,6 +202,12 @@ interface TemplateContext {
180
202
-`onDeactivated(eventResponse: any): void`
181
203
Trigger an event reponse whenever your component gets removed from this block
182
204
205
+
-`lootTable(lootTable: any): string`
206
+
Returns a string that points to your defined loot table
207
+
208
+
-`recipe(recipe: any): void`
209
+
Creates a new recipe for blocks that use the custom component
210
+
183
211
### Creating Files
184
212
185
213
Files can also be automatically created with custom components. Functions that can be called to create files are:
0 commit comments