#Help!
1 messages · Page 1 of 1 (latest)
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
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
What i need to import from minecraft-sever?
Nothing
Just change victim.entity.location to victim.location
You are trying to get undefined method
well
property
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!
calm down lmao
get out of "discord mod" mode
had a hard day.. sorry
👍
sorry
didn't work
just a tipp for next time ; )
impulse to what direction
impulse to victim location
what does it say now
show code
just send screenshots
Easier for me on phone
I think It’s because u didn’t put x,y,z tho
Probably
Victim is already an entity
did he not change it?
^
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
did not work
yes