#My scripts that worked in version 1.19.80 stopped working in version 1.20
1 messages · Page 1 of 1 (latest)
Main
Template
Ui
I can't identify the error... It's been happening since Minecraft 1.20 beta
you can look at changelog there is mayn information vvhat helps you fixing your code
#1067535712372654091
#1116399323580739684
I don't know how to fix
That's why I'm asking for help, friend
ok, please send codes directly i can't load images on my phone
Ok
? formating
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.
console.log("hello world", 123)
MAIN
import * as ui from './ui.js';
import * as mc from '@minecraft/server';
import { system, world } from '@minecraft/server';
system.runInterval(() => {
for (const player of mc.world.getPlayers()) {
ui.repeat(player);
}
}, 5)
UI
import * as mc from '@minecraft/server';
import * as consult from './template';
export function repeat(player) {
player.onScreenDisplay.setTitle(
`[EP:${parseInt(consult.score(player, "ep") / consult.score(player, "ep_eval") * 100)}]
[HP:${parseInt(consult.score(player, "hp") / consult.score(player, "hp_eval") * 100)}]`
);
}
TEMPLATE
import * as mc from '@minecraft/server';
export function score(player, objective) {
try {
return mc.world.scoreboard.getObjective(objective).getScore(player.scoreboard)
} catch (e) { return 0; }
}
last one is vvrong is guess
change
player.scoreboard
to
player.scoreboardIdentity
Ok