A database manager for storing unlimited array in ScriptAPI
Compatible with @minecraft/server@1.10.0+
JavaScript
/** @type {ArrayDatabase<string>} */constdb=newArrayDatabase('test');db.add('hello');db.add('world');db.getAll();// ["hello", "world"]db.has('hello');// truedb.clear();db.size;// 0TypeScript
constdb=newArrayDatabase<Vector3>('test');db.add({x: 0,y: 0,z: 0});db.add({x: 1,y: 1,z: 1});db.getAll();// [{ x: 0, y: 0, z: 0 }, { x: 1, y: 1, z: 1 }]- (template)
T readonly id: stringget size(): numbergetAll(): T[]add(value: T): thishas(value: T): booleanclear(): void*values(): IterableIterator<T>find(callbackfn: (value: T) => boolean): T | undefinedfilter(callbackfn: (value: T) => boolean): T[]map<U>(callbackfn: (value: T) => U): U[]forEach(callbackfn: (value: T) => void): voidsome(callbackfn: (value: T) => boolean): booleanevery(callbackfn: (value: T) => boolean): boolean[Symbol.iterator](): IterableIterator<T>
| x10 | x100 | |
|---|---|---|
| string(100bytes) | 0ms | 6ms |
| vector3 | 1ms | 34ms |