UNPKG

@boem312/minecraft-server

Version:

A pure JS library to create Minecraft Java 1.16.3 servers

25 lines (22 loc) 592 B
module.exports = { tabItems: { info: { preventSet: true }, get() { return this.p._tabItems; }, set(newValue) { const oldValue = [...this.tabItems]; this.p._tabItems = newValue; const changed = newValue.length !== oldValue.length || newValue.some((a, i) => a !== oldValue[i]); if (changed) this.p.emitChange('tabItems', oldValue); }, init() { this.p._tabItems = Object.freeze([]); } } }