#scores not loading properly after 1.20

1 messages · Page 1 of 1 (latest)

obsidian rover
#

?code

warm basaltBOT
#
Formatting JSON, JS

Please format your code as code-blocks! This makes the text monospaced, and has support for syntax highlighting.

The format looks like this:

for JSON
```json
{
"example": 123
}
```

for JavaScript
```js
console.log("hello world", 123) 
```

The character used here is the backtick (U+0060 ` GRAVE ACCENT). This symbol is usually at the top left of your keyboard, occupying the tilde key (~). On mobile, it will be on the second or third page of symbols.

tired fableBOT
#
Debug Result

JavaScript/TypeScript code blocks not detected in [message](#1117540782451208223 message).
You can either send the script in code block highlighted in JS format:

​`​`​`js
world.sendMessage("Hello World");
​`​`​`

Or Send an attachment end in .js to debug the file.

#
Debug Result

There are 7 errors in this [code](#1117540782451208223 message):

<repl>.js:2:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

2 import { rankDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:3:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

3 import { clanDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:6:20 - error TS2307: Cannot find module '../config' or its corresponding type declarations.

6 import config from "../config";
                     ~~~~~~~~~~~

``````ansi
<repl>.js:11:40 - error TS2339: Property 'getPlayerScore' does not exist on type 'Scoreboard'.

11         const playerScore = scoreboard.getPlayerScore(player, objective);
                                          ~~~~~~~~~~~~~~

``````ansi
<repl>.js:19:1 - error TS1128: Declaration or statement expected.

19 }
   ~

``````ansi
<repl>.js:21:4 - error TS1128: Declaration or statement expected.

21    }
      ~

``````ansi
<repl>.js:22:1 - error TS1128: Declaration or statement expected.

22 }
   ~

#
Debug Result

There are 11 errors in this [code](#1117540782451208223 message).
Please read the attached file for the result.

#
Debug Result

There are 11 errors in this [code](#1117540782451208223 message).
Please read the attached file for the result.

#
Debug Result

There are 7 errors in this [code](#1117540782451208223 message):

<repl>.js:2:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

2 import { rankDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:3:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

3 import { clanDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:6:20 - error TS2307: Cannot find module '../config' or its corresponding type declarations.

6 import config from "../config";
                     ~~~~~~~~~~~

``````ansi
<repl>.js:12:28 - error TS2339: Property 'getValue' does not exist on type 'number'.

12         return playerScore.getValue();
                              ~~~~~~~~

``````ansi
<repl>.js:19:1 - error TS1128: Declaration or statement expected.

19 }
   ~

``````ansi
<repl>.js:21:4 - error TS1128: Declaration or statement expected.

21    }
      ~

``````ansi
<repl>.js:22:1 - error TS1128: Declaration or statement expected.

22 }
   ~

#
Debug Result

There are 9 errors in this [code](#1117540782451208223 message):

<repl>.js:6:28 - error TS2339: Property 'getValue' does not exist on type 'number'.

6         return playerScore.getValue();
                             ~~~~~~~~

``````ansi
<repl>.js:13:1 - error TS1128: Declaration or statement expected.

13 }
   ~

``````ansi
<repl>.js:15:4 - error TS1128: Declaration or statement expected.

15    }
      ~

``````ansi
<repl>.js:16:1 - error TS1128: Declaration or statement expected.

16 }
   ~

``````ansi
<repl>.js:31:100 - error TS2304: Cannot find name 'rankDefault'.

31         let playerRank = player.getTags().find(tag => tag.startsWith("rank:"))?.substring(5) ?? `${rankDefault}`;
                                                                                                      ~~~~~~~~~~~

``````ansi
<repl>.js:32:100 - error TS2304: Cannot find name 'clanDefault'.

32         let playerClan = player.getTags().find(tag => tag.startsWith("clan:"))?.substring(5) ?? `${clanDefault}`;
                                                                                                      ~~~~~~~~~~~

tired fableBOT
# tired fable
Debug Result

There are 9 errors in this [code](#1117540782451208223 message):

<repl>.js:38:60 - error TS2304: Cannot find name 'config'.

38             player.onScreenDisplay.setTitle(`\n §r§kii§r ${config.SERVER_NAME} §r§kii§r \n\n §6[ Your Stats ]\n §6Name: §7${player.name}\n §6Money: §7${config.CURRENCY}${metricNumbers(getScore(player, "money"))}\n §6Rank: ${playerRank}\n §6Clan: ${playerClan}\n §6Kill: §7${getScore(player, "kills")}x\n §6Death: §7${getScore(player, "death")}x \n\n §6[ Server Stats ]\n §6Online: §7${getScore(player, "online")} / ${config.MAX_ONLINE}\n §6Location:\n §7${x}, ${y}, ${z}\n\n §6[ Info ]\n Realm Code: §7ULAkPAEUL_M \n §6Discord Code: §7gPz5P72mNA`);
                                                              ~~~~~~

``````ansi
<repl>.js:38:153 - error TS2304: Cannot find name 'config'.

38             player.onScreenDisplay.setTitle(`\n §r§kii§r ${config.SERVER_NAME} §r§kii§r \n\n §6[ Your Stats ]\n §6Name: §7${player.name}\n §6Money: §7${config.CURRENCY}${metricNumbers(getScore(player, "money"))}\n §6Rank: ${playerRank}\n §6Clan: ${playerClan}\n §6Kill: §7${getScore(player, "kills")}x\n §6Death: §7${getScore(player, "death")}x \n\n §6[ Server Stats ]\n §6Online: §7${getScore(player, "online")} / ${config.MAX_ONLINE}\n §6Location:\n §7${x}, ${y}, ${z}\n\n §6[ Info ]\n Realm Code: §7ULAkPAEUL_M \n §6Discord Code: §7gPz5P72mNA`);
                                                                                                                                                           ~~~~~~

``````ansi
<repl>.js:38:418 - error TS2304: Cannot find name 'config'.

38             player.onScreenDisplay.setTitle(`\n §r§kii§r ${config.SERVER_NAME} §r§kii§r \n\n §6[ Your Stats ]\n §6Name: §7${player.name}\n §6Money: §7${config.CURRENCY}${metricNumbers(getScore(player, "money"))}\n §6Rank: ${playerRank}\n §6Clan: ${playerClan}\n §6Kill: §7${getScore(player, "kills")}x\n §6Death: §7${getScore(player, "death")}x \n\n §6[ Server Stats ]\n §6Online: §7${getScore(player, "online")} / ${config.MAX_ONLINE}\n §6Location:\n §7${x}, ${y}, ${z}\n\n §6[ Info ]\n Realm Code: §7ULAkPAEUL_M \n §6Discord Code: §7gPz5P72mNA`);
                                                                                                                                                                                                                                                                                                                                                                                                                                    ~~~~~~

#
Debug Result

There are 7 errors in this [code](#1117540782451208223 message):

<repl>.js:2:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

2 import { rankDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:3:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

3 import { clanDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:6:20 - error TS2307: Cannot find module '../config' or its corresponding type declarations.

6 import config from "../config";
                     ~~~~~~~~~~~

``````ansi
<repl>.js:12:28 - error TS2339: Property 'getValue' does not exist on type 'number'.

12         return playerScore.getValue();
                              ~~~~~~~~

``````ansi
<repl>.js:19:1 - error TS1128: Declaration or statement expected.

19 }
   ~

``````ansi
<repl>.js:21:4 - error TS1128: Declaration or statement expected.

21    }
      ~

``````ansi
<repl>.js:22:1 - error TS1128: Declaration or statement expected.

22 }
   ~

#
Debug Result

There are 11 errors in this [code](#1117540782451208223 message).
Please read the attached file for the result.

#
Debug Result

There are 9 errors in this [code](#1117540782451208223 message):

<repl>.js:1:24 - error TS2305: Module '"@minecraft/server"' has no exported member 'Score'.

1 import { world,system, Score  } from "@minecraft/server"
                         ~~~~~

``````ansi
<repl>.js:2:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

2 import { rankDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:3:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

3 import { clanDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
<repl>.js:6:20 - error TS2307: Cannot find module '../config' or its corresponding type declarations.

6 import config from "../config";
                     ~~~~~~~~~~~

``````ansi
<repl>.js:11:28 - error TS8010: Type annotations can only be used in TypeScript files.

11         const playerScore: Score = scoreboard.getScore(player, objective);
                              ~~~~~

``````ansi
<repl>.js:19:4 - error TS1128: Declaration or statement expected.

19    }
      ~

``````ansi
<repl>.js:20:1 - error TS1128: Declaration or statement expected.

20 }
   ~

``````ansi
<repl>.js:46:36 - error TS2339: Property 'clearTitle' does not exist on type 'ScreenDisplay'.

46             player.onScreenDisplay.clearTitle();
                                      ~~~~~~~~~~

``````ansi
<repl>.js:65:68 - error TS2339: Property 'current' does not exist on type 'EntityHealthComponent'.

65         let playerHealth = player.getComponent("minecraft:health").current
                                                                      ~~~~~~~

obsidian rover
#

here

tired fableBOT
#
Debug Result

There are 8 errors in this [code](#1117540782451208223 message):

message.js:2:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

2 import { rankDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
message.js:3:29 - error TS2307: Cannot find module '../Ranks/configuration.js' or its corresponding type declarations.

3 import { clanDefault } from "../Ranks/configuration.js";
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~

``````ansi
message.js:5:20 - error TS2307: Cannot find module '../config' or its corresponding type declarations.

5 import config from "../config";
                     ~~~~~~~~~~~

``````ansi
message.js:29:101 - error TS2731: Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'.

29                     if (!entity.scoreboardIdentity) entity.runCommand(`scoreboard players set @s "${obj}" ${score}`);
                                                                                                       ~~~

``````ansi
message.js:62:19 - error TS2339: Property 'scores' does not exist on type 'Player'.

62             let { scores, name } = player
                     ~~~~~~

``````ansi
message.js:95:16 - error TS2339: Property 'scores' does not exist on type 'Player'.

95         player.scores.online += 1;
                  ~~~~~~

``````ansi
message.js:100:16 - error TS2339: Property 'scores' does not exist on type 'Entity'.

100     deadEntity.scores.death += 1;
                   ~~~~~~

``````ansi
message.js:102:57 - error TS2339: Property 'scores' does not exist on type 'Entity'.

102     if (attacker?.typeId == deadEntity.typeId) attacker.scores.kills += 1
                                                            ~~~~~~

obsidian rover
#

all gud ig

obsidian rover
#

thats how set it up

#

change it to world.getAllPlayers().length

#

nice