FastLeafDecay
Speed up leaf decay in Minecraft
Purpose
Leaves in Minecraft will decay when they are not connected to a log block directly or via other leaves by a distance of 6 blocks or less. The game will udpate their distance very quickly, but only gradually and very slowly arrange for their decay. This is where the FastLeafDecay plugin comes in. It will realize whenever a leaves block gets disconnected from any nearby logs keeping it alive, and schedule a prompt decay. A variety of configuration options are included.
Features
FastLeafDecay works automatically on all leaves which are not player placed and does not require any permissions or configuration, although configuration is provided, see below.
- Leaves decay quickly after the tree stem was cut.
- Leaves decay quickly around natural decay events.
- Natural drops, such as saplings and apples, are unaffected.
- Player placed leaves (with the
persistent
flag) are unaffected. - Limit decay to certain worlds or blacklist worlds in the configuration.
- Play a sound and animation for better player feedback. This can be disabled in the config.
- Devs: This plugin calls
LeavesDecayEvent
before taking action and respects its cancellation state.
Compatibility
FastLeafDecay uses Spigot's modern BlockData
and Tag
frameworks and will therefore only work on Bukkit or Spigot 1.13or above. Builds compatible with Bukkit 1.12 or 1.8 can be found in the Links section below.
Installation
- Drop the
FastLeafDecay.jar
into yourplugins
folder and restart the server or load the plugin manually. - (Optional) Edit the
plugins/FastLeafDecay/config.yml
file and restart the server or reload the plugin manually.
Configuraton
Many features of FastLeafDecay can be configured in the config.yml
file. To apply your changes, either restart your server or reload the plugin manually. To revert to the plugin defaults, delete the file and a new one will be created next time the plugin gets loaded.
# Leave this string list empty to enable all worlds.
OnlyInWorlds: []
# List worlds you wish to exclude from sped up leaves decay.
ExcludeWorlds: []
# Delay in ticks to check around broken blocks.
# Must be at least 5 to guarantee proper function.
BreakDelay: 5
# Delay in ticks to check around decaying leaves.
DecayDelay: 2
# Break blocks one by one. If set to true, no more than one leaf block
# will be broken at once.
OneByOne: false
# Play additional effects
SpawnParticles: true
PlaySound: true
Does this plugin work for 1.20.2?
Is it possible to disable drops anyhow? If no, could you please make an option for that?
1.16 ?
Would it be possible to slightly reduce the delay at which the leaves are broken? I have BreakDelay set to 5, which is the default and can’t be lower according to the config.
In reply to Forge_User_49840962:
BreakDelay is the delay after a leaf or log was broken by a player and before any of the surrounding leaves are considered for decay. You want to lower the DecayDelay which is the interval between a leaf decaying for whatever reason, and the plugin stepping in to consider the surrounding leaves. It can be set as low as you want, even 0. If OneByOne is active, it will go no lower than 1. I hope this helps.
In reply to StarTux:
I should explain the reason why BreakDelay has to be at least 5: From experience, this is the time it takes the server to update any leaf surrounding a broken block, to know the distance to the nearest log, if any. Setting it lower than 5 will register and might still work but will produce some false negatives. Nevertheless, fast leaf decay will pick up again once the first leaf starts decaying normally, as that will trigger this plugin to do its thing.
We could get around this by searching for the nearest log block on a leaf ourselves, but I wanted to avoid this to keep the plugin as simple as possible. Perhaps in the future.
In reply to StarTux:
Well, DecayDelay is already set to 1 as it is by default, and I do have OneByOne enabled. So, I cannot reduce either BreakDelay or DecayDelay. It does feel like it takes a little too long before a tree’s leaves start to decay after a player breaks the logs, though, but I can live with it.
What’s the formatting of OnlyInWorlds and ExcludeWorlds?
Is it like this?
ExcludeWorlds: [world1,world2,world3]
Or like this?
ExcludeWorlds: ['example','world','world3']
In reply to Forge_User_49840962:
Either version should work just fine. YAML allows quoted as well as unquoted strings.
I love your plugin. Works great in 1.15.1! I was just wondering, though: Could you please add a config option to make the leaf blocks decay one by one similar to how they do with mods like Fast Leaf Decay and Quick Leaf Decay installed in modded Minecraft, rather than all the leaf blocks disappearing simultaneously?
In reply to Forge_User_49840962:
Hello and thank you! The new build with the OneByOne option in the config is currently awaiting approval. Set it to true to ensure that no more than one leaf block is broken at once.
In reply to StarTux:
Sweet! Thank you. I’ll test it out.
Edit: It works perfectly! Thanks for implementing it so fast after my request.
Great plugin! Congratulations!