some months ago i wrote a index.js with chatgpt and everything worked as intended: custom chat prefixes and preventing the usage of some items (like axes on logs) . this script doesnt work anymore and after the long time i forgot the basics of the script api, could someone help please? also maybe something iswrong with the manifest.json if someone could direct me to a tutorial what uuids to use
#index.js stopped working
1 messages · Page 1 of 1 (latest)
Debug Result
There are 4 errors in this [code](#1148909648427089980 message):
[36mindex.js[0m:[33m1[0m:[33m10[0m - [31merror[0m[30m TS2300: [0mDuplicate identifier 'world'.
[7m1[0m import { world, system, Player } from "@minecraft/server";
[7m [0m [31m ~~~~~[0m
``````ansi
[36mindex.js[0m:[33m2[0m:[33m13[0m - [31merror[0m[30m TS2300: [0mDuplicate identifier 'world'.
[7m2[0m import * as world from "@minecraft/server";
[7m [0m [31m ~~~~~[0m
``````ansi
[36mindex.js[0m:[33m4[0m:[33m7[0m - [31merror[0m[30m TS2339: [0mProperty 'events' does not exist on type 'World'.
[7m4[0m world.events.beforeItemUseOn.subscribe((beforeItemUseOn) => {
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mindex.js[0m:[33m59[0m:[33m7[0m - [31merror[0m[30m TS2339: [0mProperty 'events' does not exist on type 'World'.
[7m59[0m world.events.beforeChat.subscribe((data) => {
[7m [0m [31m ~~~~~~[0m
Debug (Stable)
is this new? where are all those changes listed?
my script is somehow still not working :(
i renamed it to main.js to test if that helped, but nope
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.5.0-beta"
},
{
"module_name": "@minecraft/server-gametest",
"version": "1.0.0-beta"
},
{
"module_name": "@minecraft/server-ui",
"version": "1.2.0-beta"
}
],
"format_version": 2,
"header": {
"name": "§g§lBase",
"description": "§7Base",
"uuid": "14e467b4-e3aa-49d3-8352-f8439fd7b2ee",
"version": [0, 0, 1],
"min_engine_version": [1, 20, 0]
},
"modules": [
{
"type": "data",
"uuid": "854b16b0-cf13-4711-af75-1e3014ccbaac",
"version": [
1,
0,
0
]
},
{
"language": "javascript",
"description": "script",
"type": "script",
"uuid": "7c7e693f-99f4-41a9-95e0-1f57b37e1e12",
"version": [0, 0, 1],
"entry": "scripts/main.js"
}
]
}``` this is the manifest
in the addon i also have a custom entity, custom blocks and custom loot tables. theywork fine though
except for the script
const player = beforeItemUseOn.source;
const item = beforeItemUseOn.itemStack;
is this the only ting thats wrong?
like when ichange it it should work?
thanks for replying tho :)
no
im on 1.20.15
and sadlyits still not working :(
both the chat prefixes and the item use preventer
"module_name": "@minecraft/server",
"version": "1.4.0-beta"
thats great then