Hello,
I wanted to share the inventory plugin.
Important things to keep in mind:
- This plugin does not overwrite the native items system, so you have to maintain both.
For example, if you add an item like this:
player.addItem(Potion, 500);
Then you have also use the plugins' add item method which will divide these stacks by max stack size:
player.inventory.addItem({
itemId: 'potion',
type: 'item',
nb: 500,
})
- The type of item is required to determine which part of the equipment you want to equip.
- This plugin includes extended decorators for Item, Weapon, Armor etc. because you can set for example
icon
spritesheet
import { Item, Weapon, Armor } from 'rpgjs-inventory';
- This plugin has only the
server
side part ready to use, the client
side is your choice of how to implement that (there is an example).
It's not well documented yet and amount of tests will be increased but feel free to use and give feedback 😄
Plugin: https://github.com/dominx99/rpgjs-plugins/tree/master/plugins/inventory
Example implementation: https://github.com/dominx99/rpgjs-plugins/tree/master/examples/inventory