Hi!
I am new but I enjoy RPGJS very much. I have problems with custom item parameters though. Every example I have tried to follow includes removing the 'default' from export class [item]. This always results in:
TypeError: Cannot read properties of undefined (reading 'id')
I have tried this I found from the forum:
import { Item } from '@rpgjs/database'
@Item({
name: 'CustomItem'
})
export class CustomItem {
custom: number = 200
}
And this, from the documentation:
import { RpgPlayer } from '@rpgjs/server'
import { Item } from '@rpgjs/database'
@Item({
name: 'Potion',
description: 'Gives 100 HP',
price: 200,
hpValue: 100,
hitRate: 1,
consumable: true,
addStates: [],
removeStates: [],
elements: [],
effects: [],
paramsModifier: {}
})
export class Potion {
onAdd(player: RpgPlayer) {
}
onUse(player: RpgPlayer) {
}
onUseFailed(player: RpgPlayer) {
}
onRemove(player: RpgPlayer) {
}
}
Any advice here? Thanks!