Falling Leaves
execute @a ~ ~ ~ spreadplayers ~ ~ 3 20 false @e[tag=LveDetc,c=1]
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
This command randomly teleports an invisible ArmorStand around the player. This ArmorStand will allow us to randomly select leaves blocks.
execute @e[tag=LveDetc] ~ ~-1 ~ detect ~ ~ ~ leaves -1 summon ArmorStand ~ ~ ~ {Tags:["LveDetc1","LveDetc11"],Small:1,Invisible:1,Invulnerable:1,NoGravity:1,
HandItems:[{id:tallgrass,Damage:2,Count:1},{}],DisabledSlots:2039583}
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
This command summons an invisible ArmorStand with a fern in his hand, when the first armorstand will detect a leaves block.
tp @e[tag=LveDetc11] ~ ~-.05 ~
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
As long as the "leaf" ArmorStand has that tag it will keep falling down.
We'll need this tag to determine when the leaf has to land on the ground and stop falling.
entitydata @e[tag=LveDetc1] {Tags:["LveDetc1","LveNetc0"]}
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
In a few words this command adds every tick the tag "LveNetc0"
I'll explain later why we need this.
execute @e[tag=LveDetc1] ~ ~ ~ detect ~ ~0.4 ~ air 0 entitydata @e[c=1] {Tags:["LveDetc1","LveDetc11","LveNetc1"]}
execute @e[tag=LveDetc1] ~ ~ ~ detect ~ ~0.4 ~ leaves -1 entitydata @e[c=1] {Tags:["LveDetc1","LveDetc11","LveNetc1"]}
execute @e[tag=LveDetc1] ~ ~ ~ detect ~ ~0.4 ~ snow_layer -1 entitydata @e[c=1] {Tags:["LveDetc1","LveDetc11","LveNetc1"]}
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
These 3 commands set the tag "LveNetc1" and delete the tag "LveNetc0" only when the leaf is touching air, leaves or snow layers. So when the leaf is not touching any of those blocks (aka is touching a solid block) it will have the tag "LveNetc0"
scoreboard players add @e[tag=LveNetc0] nEElt 1
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
This command adds a score to every leaf touching the ground.
kill @e[tag=LveNetc0,score_nEElt_min=50]
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
When the score will reach 50 ticks (aka 2,5 seconds = 50:20) the leaf will disappear.
tp @e[tag=LveNetc1] ~ ~ ~ ~5 ~
TIP: In order to copy the command selct it and than press Ctrl + C or CMD + C.
This command adds a little animation effect to every leaf which is falling.
/scoreboard objectives add nEElt dummy
/summon ArmorStand ~ ~1 ~ {Tags:["LveDetc"],Marker:1b,NoGravity:1,Invisible:1,Invulnerable:1}
© Cimap. All Rights Reserved
This website is not endorsed, associated or affiliated with Mojang AB.