#I need help with something simple

1 messages · Page 1 of 1 (latest)

devout bobcatBOT
#
Debug Result

There is an error in this [code](#1246081607899812032 message):

<repl>.js:12:90 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'Effect'.

12         if (block.permutation.matches("minecraft:stone") || player.getEffects().includes("resistance")) {
                                                                                            ~~~~~~~~~~~~

steep mantle
#

location.y--

#

You are setting your y location at minus one

languid crow
steep mantle
#

The settitle 😭😭😭

steep mantle
#

You are searching in y (-1)

fierce gyro
#

Can't he just do this?

system.runInterval(()=>{
    for (const player of world.getAllPlayers()) { 
        const block = player.dimension.getBlock(player.location)
        if (block.below().permutation.matches("minecraft:stone") || player.getEffects().includes("resistance")) {
            player.onScreenDisplay.setTitle("Eres bien puta")
        }
    }
}, 15)```
steep mantle
#

Not the current location - 1

languid crow
fierce gyro
languid crow
languid crow
steep mantle
#

The block at the legs

languid crow
steep mantle
#

The block what is "transpasing" the player legs is the already declared const block = ...

#

To get the block at the head like when is suffocating use block.above()

languid crow
steep mantle
#

???

#

The block is standing on???

languid crow
steep mantle
#

const block = player.dimension.getBlock(player.location)
This

languid crow
languid crow
steep mantle
#

You need to use find() method, but its not necessary, dont retrieve all effects, just use player.getEffect('resistance')

languid crow