#cannot read typeId of undefined

1 messages · Page 1 of 1 (latest)

full tusk
#

key?.typeId

icy turtle
#

use optional chaining there too.
?.getComponent(...)

#

player.dimension?.getBlock(...)

#

show the error.

sweet cobalt
#

is that block loaded?

icy turtle
#

that's not about getBlock.

full tusk
#

?.getComponent

icy turtle
full tusk
#

"verbally"

#

oh

#

;-;

icy turtle
#

and what is the item variable?

full tusk
#
inv.addItem(new ItemStack("obsidian"))
icy turtle
#

well hold on, maybe he needs an existing item stack

#

to copy itemStack data

#

what is your item variable

#

nvm I just read what this script was.

icy turtle
#

make sure to import the ItemStack class from server.

full tusk
#

uhm, use

item && inv.addItem(item)
full tusk
#

its like

const item = inv.getItem(number)
if (item) inv.addItem(item)
icy turtle
#

ah, so I was right about keeping the variable

#

sorry lol

#

just pay attention to what m9 is saying

full tusk
#

that number slot may try to get an empty slot one, so use such condition

#

remove + 1