Open respectZ opened 3 months ago
added this func to filter the non users (havent tested):
function getEntitiesExceptUser(player: mc.Player) { const entities = mc.world.getDimension("overworld").getEntities({ location: player.location, maxDistance: 5, }); return entities.filter((entity) => entity.id !== player.id); }
Netherite Sickle
[x] Get targets https://github.com/euphori/Dummy-Project-RGL/blob/fbee7b6e6c608210fbeb102c8ebda65200fa9d3b/data/scripts/netherite_sickle.ts#L112-L116 Consider a different approach for getting entities since this one mean another player will be immune to the ability.
[x]
system.runTimeout
https://github.com/euphori/Dummy-Project-RGL/blob/fbee7b6e6c608210fbeb102c8ebda65200fa9d3b/data/scripts/netherite_sickle.ts#L125-L151 Be careful when usingsystem.runTimeout
since the entity could be invalid in the future. Consider addingentity.isValid()
for every timeouts.[x] Apply damage source https://github.com/euphori/Dummy-Project-RGL/blob/fbee7b6e6c608210fbeb102c8ebda65200fa9d3b/data/scripts/netherite_sickle.ts#L118-L124 Consider adding
damager
. Withoutdamager
, neutral mobs will stay passive (e.g spider during daytime)Or using the native API
Golden Kings Excalibur
[x] Apply damage source https://github.com/euphori/Dummy-Project-RGL/blob/fbee7b6e6c608210fbeb102c8ebda65200fa9d3b/data/scripts/golden_kings_excalibur.ts#L22-L28
[x] Get targets https://github.com/euphori/Dummy-Project-RGL/blob/fbee7b6e6c608210fbeb102c8ebda65200fa9d3b/data/scripts/golden_kings_excalibur.ts#L31-L35
[x]
system.runTimeout
https://github.com/euphori/Dummy-Project-RGL/blob/fbee7b6e6c608210fbeb102c8ebda65200fa9d3b/data/scripts/golden_kings_excalibur.ts#L38-L45 https://github.com/euphori/Dummy-Project-RGL/blob/fbee7b6e6c608210fbeb102c8ebda65200fa9d3b/data/scripts/golden_kings_excalibur.ts#L69-L76