jojoe77777 / Icarus

Elytra datapack for speedruns
1 stars 2 forks source link

Reliability+efficiency improvement: tag, player focus #1

Open Fabian42 opened 3 years ago

Fabian42 commented 3 years ago

Disclaimer: I've not tried anything, only read the code and wrote this from memory. If this datapack is run on a server at world creation, nobody would get the items unless they join within half a second of its initial start and are online at the moment it triggers. Instead of a global thing, you could do something like this:

execute as @a[tag=!elytra] run function icarus/items

And then as a file items.mcfunction:

give @s elytra{Unbreakable:1}
give @s firework_rocket{Fireworks:{Flight:3}} 64
tag @s add elytra

This way everyone would get the items when they first join. This also improves performance (but that shouldn't be a big deal currently either) and makes the code a bit cleaner. You can also completely remove the init function then.

Fabian42 commented 3 years ago

Also: Maybe /replaceitem instead of /give for elytra?