Skip to content

Commit

Permalink
rename modifyItem to modifyItemEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
LLytho committed Jan 11, 2025
1 parent 6e2ac4f commit d6b75e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions wikis/lootjs/docs/api/loot-entries-transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ LootJS.lootTables(event => {

## `replaceItem`

Replaces all items that matches the filter with the given item. By replacing the item all loot conditions and item functions are kept. If you don't want this use [`modifyItem`](#) and create your own `LootEntry`.
Replaces all items that matches the filter with the given item. By replacing the item all loot conditions and item functions are kept. If you don't want this use [`modifyItemEntry`](#) and create your own `LootEntry`.

- Syntax:
- `.replaceItem(filter: ItemFilter, item: Item)`, _<sub>see [ItemFilter]</sub>_
Expand Down Expand Up @@ -118,16 +118,16 @@ LootJS.lootTables(event => {
})
```

## `modifyItem`
## `modifyItemEntry`

Same as `modifyEntry` but will only iterates through `LootItemEntry`s.
Same as `modifyItemEntry` but will only iterates through `LootItemEntry`s.

- Syntax:
- `.modifyItem((entry: LootItemEntry) => { ... })`
- `.modifyItemEntry((entry: LootItemEntry) => { ... })`

```js
LootJS.lootTables(event => {
event.getLootTable("minecraft:chests/simple_dungeon").modifyItem(itemEntry => {
event.getLootTable("minecraft:chests/simple_dungeon").modifyItemEntry(itemEntry => {
if (itemEntry.item.id === "minecraft:string") {
itemEntry.setCount([5, 12])
}
Expand Down
2 changes: 1 addition & 1 deletion wikis/lootjs/docs/loot-tables/modify-loot-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ LootJS.lootTables(event => {
event
.getLootTable("minecraft:chests/desert_pyramid")
.firstPool()
.modifyItem(itemEntry => {
.modifyItemEntry(itemEntry => {
if (itemEntry.item.id === "minecraft:diamond") {
itemEntry.setWeight(1)
}
Expand Down

0 comments on commit d6b75e2

Please sign in to comment.