Started by
RedWirePlatinum
on
Topic category: User side tutorials
The "source" string var is only so i can have the provided damage source
be a required dependency.
to get the source entity from damage source, use a custom code snippet and put this into it:
damagesource.getEntity()
(In case you're confused why this says getEntity and not getDirectEntity like in the image, I realized that getDirectEntity is the same as immediatesourceentity)
(the local variable does not need to be named sourceentity by the way)
if sourceentity is null, do not try using it with anything otherwise it will likely cause game crashes
Edited by RedWirePlatinum on Thu, 09/28/2023 - 20:11
Aaaaaaaand I just shortly realized that it's actually
damagesource.getEntity()
sincedamagesource.getDirectEntity()
could also refer to arrows or whatever