-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (28 loc) · 982 Bytes
/
index.js
File metadata and controls
30 lines (28 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Script example for ScriptAPI
// Author: Jayly#1397 <Jayly Discord>
// Project: https://github.com/JaylyDev/ScriptAPI
import { Dimension, world } from "@minecraft/server";
/**
* Get entities that are in specific dimension
* @param {Dimension} dimension
* @param {import("@minecraft/server").EntityQueryOptions} [options]
*/
export function getEntities(dimension, options) {
const mergedOptions = {
minDistance: 0,
...(typeof options.minDistance !== 'undefined' ? { minDistance: options.minDistance } : {})
};
return dimension.getEntities(mergedOptions);
};
/**
* Get players that are in specific dimension
* @param {Dimension} dimension
* @param {import("@minecraft/server").EntityQueryOptions} [options]
*/
export function getPlayers(dimension, options) {
const mergedOptions = {
minDistance: 0,
...(typeof options.minDistance !== 'undefined' ? { minDistance: options.minDistance } : {})
};
return dimension.getPlayers(mergedOptions);
};