#Help!

1 messages · Page 1 of 1 (latest)

elder bridge
#

The line 28 do not work

#

Content Log

grizzled karma
#

add a test so if there is no damagingEntity or hitEntity the code doesn't execute
also i think using the location as an impulse is too much

dawn thorn
#

No it’s not that

#

it’s because you’re defining victim as mob.hitEntity when that returns the entity class, then your basically trying to call a method called “entity” in the location object, because “entity” is not a valid method it will return this error so to fix this, you do “victim.location” not “victim.entity.location”

#

@elder bridge

elder bridge
dawn thorn
#

Nothing

#

Just change victim.entity.location to victim.location

#

You are trying to get undefined method

#

well

#

property

compact oak
#

DO NOT SEND SCREENSHOTS OF YOUR CODE, IF PEOPLE WANNA TRY YOUR CODE AND FIX IT THEY DO NOT WANT TO TYPE IT ALL OUT!

grave sonnet
#

get out of "discord mod" mode

compact oak
#

had a hard day.. sorry

grave sonnet
#

👍

elder bridge
compact oak
valid terrace
elder bridge
dawn thorn
elder bridge
dawn thorn
#

show code

elder bridge
dawn thorn
#

just send screenshots

#

Easier for me on phone

#

I think It’s because u didn’t put x,y,z tho

#

Probably

valid terrace
#

Victim is already an entity

dawn thorn
#

did he not change it?

valid terrace
#
const direction = Vector.subtract(
    victim.getHeadLocation(),
    damager.getHeadLocation()
).normalized();
direction.y = 0.7
victim.applyImpulse(direction) 
```try this one
#

Hmm, looks like there's knockback levels there

valid terrace
#

What error?

#

you're gona have to add Vector in imports

elder bridge
#

yes

valid terrace
#

import { world, system, Vector } from "@minecraft-server"

#

the direction i sent is alternative to damagerView