#ItemUse and ItemStack broken
1 messages · Page 1 of 1 (latest)
what's broken?
its not using the item
wdym?
when i right click nothing is happening
any errors in the content log gui?
ty
No problem 
wait why doesnt this work
world.beforeEvents.itemUse.subscribe((itemStack, source) => {
if (itemStack.typeId === "horc:item1") system.run(() => {openMainForm(source)})})```
There are 275 errors in this [code](#1116164047830786137 message).
Please read the attached file for the result.
@spark thicket
don't use the bot, the typings are still broken
world.beforeEvents.itemUse.subscribe({ itemStack, source } => {
if (itemStack.typeId === "horc:item1") system.run(() => {openMainForm(source)})})
ok
that code is so broken
There are 285 errors in this [code](#1116164047830786137 message).
Please read the attached file for the result.
world.beforeEvents.itemUse.subscribe(( itemStack, source ) => {
if (itemStack.typeId === "horc:item1") system.run(() => {openMainForm(source)})})```
There are 275 errors in this [code](#1116164047830786137 message).
Please read the attached file for the result.
world.beforeEvents.itemUse.subscribe(( itemStack, source ) => {
if (itemStack.typeId === "horc:item1") system.run(() => {openMainForm(source)})})
async function openMainForm(player) {
const form = new ActionFormData()
form.title('§tMain Menu')
if (!player.hasTag('playing')) form.button('§bKits\n§7Ready to Battle', 'textures/items/netherite_axe')
if (player.hasTag('Staff')) form.button('§6Owner Commands\n§7Cool Owner Commands', 'textures/ui/permissions_op_crown')
form.body(`Still in beta most likely to change`)
form.button('§sMy Stats\n§7Your KDR', 'textures/items/iron_sword')
form.button('§dMore Info\n§7Get more information!', 'textures/ui/icon_book_writable')
form.button('§1Rules\n§7Follow the Rules!', 'textures/ui/infobulb')
form.button('§cExit\n§7Leave this menu.', 'textures/ui/realms_red_x')```
There are 275 errors in this [code](#1116164047830786137 message).
Please read the attached file for the result.
world.beforeEvents.itemUse.subscribe(( itemStack, source ) => {
if (itemStack.typeId === "horc:item1") system.run(() => {openMainForm(source)})})
async function openMainForm(player) {
const form = new ActionFormData()
form.title('§tMain Menu')
if (!player.hasTag('playing')) form.button('§bKits\n§7Ready to Battle', 'textures/items/netherite_axe')
if (player.hasTag('Staff')) form.button('§6Owner Commands\n§7Cool Owner Commands', 'textures/ui/permissions_op_crown')
form.body(`Still in beta most likely to change`)
form.button('§sMy Stats\n§7Your KDR', 'textures/items/iron_sword')
form.button('§dMore Info\n§7Get more information!', 'textures/ui/icon_book_writable')
form.button('§1Rules\n§7Follow the Rules!', 'textures/ui/infobulb')
form.button('§cExit\n§7Leave this menu.', 'textures/ui/realms_red_x')
const {
selection,
canceled
} = await form.show(player)
if (canceled) return```
There are 275 errors in this [code](#1116164047830786137 message).
Please read the attached file for the result.
There are 7 errors in this [code](#1116164047830786137 message):
[36mhitDetection.js[0m:[33m87[0m:[33m14[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m87[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mhitDetection.js[0m:[33m93[0m:[33m14[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m93[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mhitDetection.js[0m:[33m100[0m:[33m23[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m100[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mhitDetection.js[0m:[33m105[0m:[33m23[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m105[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mhitDetection.js[0m:[33m124[0m:[33m14[0m - [31merror[0m[30m TS2551: [0mProperty 'player' does not exist on type 'PlayerJoinAfterEvent'. Did you mean 'playerId'?
[7m124[0m if (game.player.hasTag('incombat'))
[7m [0m [31m ~~~~~~[0m
[36m@minecraft/server.d.ts[0m:[33m16522[0m:[33m14[0m
[7m16522[0m readonly playerId: string;
[7m [0m [36m ~~~~~~~~[0m
'playerId' is declared here.
``````ansi
[36mhitDetection.js[0m:[33m125[0m:[33m11[0m - [31merror[0m[30m TS2551: [0mProperty 'player' does not exist on type 'PlayerJoinAfterEvent'. Did you mean 'playerId'?
[7m125[0m {game.player.applyDamage(1000000)
[7m [0m [31m ~~~~~~[0m
[36m@minecraft/server.d.ts[0m:[33m16522[0m:[33m14[0m
[7m16522[0m readonly playerId: string;
[7m [0m [36m ~~~~~~~~[0m
'playerId' is declared here.
``````ansi
[36mhitDetection.js[0m:[33m126[0m:[33m14[0m - [31merror[0m[30m TS2551: [0mProperty 'player' does not exist on type 'PlayerJoinAfterEvent'. Did you mean 'playerId'?
[7m126[0m game.player.runCommand('tellraw @s {"rawtext":[{"text":"§cSince you combat logged you died"}]}')
[7m [0m [31m ~~~~~~[0m
[36m@minecraft/server.d.ts[0m:[33m16522[0m:[33m14[0m
[7m16522[0m readonly playerId: string;
[7m [0m [36m ~~~~~~~~[0m
'playerId' is declared here.
(node:22) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use ​`node --trace-warnings ...​` to show where the warning was created)
/home/jail/prog.js:1
import { world, system, MinecraftEffectTypes,
There are 4 errors in this [code](#1116164047830786137 message):
[36mhitDetection.js[0m:[33m87[0m:[33m14[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m87[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mhitDetection.js[0m:[33m93[0m:[33m14[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m93[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mhitDetection.js[0m:[33m100[0m:[33m23[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m100[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m
``````ansi
[36mhitDetection.js[0m:[33m105[0m:[33m23[0m - [31merror[0m[30m TS2339: [0mProperty 'cancel' does not exist on type 'ChatSendAfterEvent'.
[7m105[0m eventData.cancel = true;
[7m [0m [31m ~~~~~~[0m