#EntityJS - Making arrows not fling off the player when damage is cancelled
43 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
i want to make the arrows phase through
ah, youll have to override the onHitEntity method
hmm
which arrow/projectile class are you extending
abstract arrow ig
hmm
i want to modify all arrows
yeah
hmm
ok sec
youll wanna use the forge projectile hit event and use the event.setImpactResult to one that phases through, you have a couple options here for that #1363726743566946405 message
[➤](#1363726743566946405 message)
mainhanditem isnt defined inside the switch statement, on top of that you have a break keyword outside of it which should be removed. if its only one check then you might as well just use another if statement instead of switch case as that is redundant logic. realistically this can be done via the forge projectile impact event where you get the projectile directly
Startup script: js ForgeEvents.onEvent("net.minecraftforge.event.entity.ProjectileImpactEvent", event => global.onProjectileImpact(event)) /**@param {Internal.ProjectileImpactEvent} event */ global.onProjectileImpact = event => { let { projectile, impactResult, rayTraceResult } = event try { if (projectile.type == "minecraft:trident") { if (rayTraceResult.type == "entity") { if (Math.random() >= 0.6) projectile.kill() } } } catch (error) { console.log("Error in onProjectileImpact: ", error) } }
"skip_entity"
youll wanna go off the hit result
event.entity is probably the projectile but im not sure
you can console log it
the ray trace result doesn't have an entity attached
wait
hold on
does it return either a hitresult or an entityhitresult?
it should be the hit result but its just HitResult which only gives you the vec3 location and the type
so you may need to also go off the entity hurt event for that
you can see if its dynamic, might be js if (event.getRayTraceResult() instanceof EntityHitResult) { let hitEntity = event.getRayTraceResult().getEntity(); }
YOOOO
let entity = event.getRayTraceResult() instanceof $EntityHitResult
console.log(entity)
oo thats sick af
thank you for the help 👍
Ticket closed!
sorry for ping, but could you pls say how to detect Parcool dodge?
necropost
??necroing

