#ItemUse and ItemStack broken

1 messages · Page 1 of 1 (latest)

shut finch
#

?

#

😮

spark thicket
#

what's broken?

shut finch
#

its not using the item

spark thicket
shut finch
#

when i right click nothing is happening

spark thicket
#

any errors in the content log gui?

shut finch
shut finch
#

ty

spark thicket
#

No problem bao_foxxo_smile

shut finch
#

wait why doesnt this work

world.beforeEvents.itemUse.subscribe((itemStack, source) => {
    if (itemStack.typeId === "horc:item1") system.run(() => {openMainForm(source)})})```
carmine rainBOT
#
Debug Result

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

shut finch
#

@spark thicket

spark thicket
spark thicket
shut finch
#

ok

carmine rainBOT
#
Debug Result

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

shut finch
#
world.beforeEvents.itemUse.subscribe(( itemStack, source ) => {
    if (itemStack.typeId === "horc:item1") system.run(() => {openMainForm(source)})})```
carmine rainBOT
#
Debug Result

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

shut finch
#
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')```
carmine rainBOT
#
Debug Result

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

shut finch
#
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```
carmine rainBOT
#
Debug Result

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

shut finch
carmine rainBOT
#
Debug Result

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

hitDetection.js:87:14 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

87    eventData.cancel = true;
                ~~~~~~

``````ansi
hitDetection.js:93:14 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

93    eventData.cancel = true;
                ~~~~~~

``````ansi
hitDetection.js:100:23 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

100             eventData.cancel = true;
                          ~~~~~~

``````ansi
hitDetection.js:105:23 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

105             eventData.cancel = true;
                          ~~~~~~

``````ansi
hitDetection.js:124:14 - error TS2551: Property 'player' does not exist on type 'PlayerJoinAfterEvent'. Did you mean 'playerId'?

124     if (game.player.hasTag('incombat'))
                 ~~~~~~

  @minecraft/server.d.ts:16522:14
    16522     readonly playerId: string;
                       ~~~~~~~~
    'playerId' is declared here.

``````ansi
hitDetection.js:125:11 - error TS2551: Property 'player' does not exist on type 'PlayerJoinAfterEvent'. Did you mean 'playerId'?

125     {game.player.applyDamage(1000000)
              ~~~~~~

  @minecraft/server.d.ts:16522:14
    16522     readonly playerId: string;
                       ~~~~~~~~
    'playerId' is declared here.

``````ansi
hitDetection.js:126:14 - error TS2551: Property 'player' does not exist on type 'PlayerJoinAfterEvent'. Did you mean 'playerId'?

126         game.player.runCommand('tellraw @s {"rawtext":[{"text":"§cSince you combat logged you died"}]}')
                 ~~~~~~

  @minecraft/server.d.ts:16522:14
    16522     readonly playerId: string;
                       ~~~~~~~~
    'playerId' is declared here.

tranquil fossilBOT
#
Program Output
(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, 
shut finch
carmine rainBOT
#
Debug Result

There are 4 errors in this [code](#1116164047830786137 message):

hitDetection.js:87:14 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

87    eventData.cancel = true;
                ~~~~~~

``````ansi
hitDetection.js:93:14 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

93    eventData.cancel = true;
                ~~~~~~

``````ansi
hitDetection.js:100:23 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

100             eventData.cancel = true;
                          ~~~~~~

``````ansi
hitDetection.js:105:23 - error TS2339: Property 'cancel' does not exist on type 'ChatSendAfterEvent'.

105             eventData.cancel = true;
                          ~~~~~~

shut finch