Skip to content

Commit 129223a

Browse files
committed
getScore fix
Now matches negative numbers
1 parent 7c51996 commit 129223a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/modules/minecraft/lib/utils/others.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function findTag({ entityRequirements } = {}, { searchTag }) {
5858
function getScore({ objective }, { entityRequirements, minimum, maximum } = {}) {
5959
const data = runCommand(`scoreboard players test @e${entityRequirements ? `[${entityRequirements.replace(/\]|\[/g, '')}]` : ''} ${objective} ${minimum ? minimum : '*'} ${maximum ? maximum : '*'}`);
6060
if(data.error) return;
61-
return data.result.statusMessage.match(/\d+/)[0];
61+
return data.result.statusMessage.match(/-?\d+/)[0];
6262
};
6363
/**
6464
* @function getPlayers() - Get an array of online players in the world

0 commit comments

Comments
 (0)