Cristichi's Tree Capitator
Tested on 1.21!
The latest build has been tested and works for 1.21.*, 1.20.*, 1.19.*, 1.18.*, 1.17.*, 1.16.*, 1.15.*, 1.14.* and 1.13.*. I recommend using the latest build always in servers running on those Minecraft versions. I'm also still around so please feel free to leave here any issues you may encounter or your suggestions if you want to, I'll read them.
Features
Please note that only the latest build supports ALL of the following features.
- Let users destroy entire trees by breaking only 1 log. Even the biggest tree will fall!
- Works on nether trees (If server is +1.16).
- Auto-update. You will get a notification if a new update is out and you don't need to come back here to download the plugin again when new features come out.
- It also destroys all leaves around.
- Auto-replant. Replanted saplings can also be automatically protected so they cannot be broken until they grow a tree.
- Switch on/off if an axe is required and/or damaged.
- VIP mode. Use it to restrict access to the benefits of this plugin, for premium users for example.
- Each player can toggle on/off the plugin for themselves. You can also configure if you want a message to remind players of their current setting when they log in.
- Players are not able to break logs in protected areas (by WorldGuard or other protection plugins using WorldGuard as a dependency).
- Axes are damaged accordingly.
- Switch on/off if axes should be prevented from being broken. So that you can repair that nice axe with Mending or an anvil and never worry about it being broken. (only works when breaking logs with it, breaking anything else will destroy the axe anyway)
- Switch on/off if tree leaves should be ignored by the plugin. Enabling it will make the plugin take down only connected logs, reducing the lag and balancing a little bit.
- Crouch mode. Use true in this configuration so that crouching players not trigger this plugin. Use inverted to make standing players not trigger this plugin, or false to make crouching not change how this plugin works.
- Customize what are trees! Configure any block to be treated as tree logs or as tree leaves for this plugin. Scroll down to see more specific steps on this page.
- Ask for new features by DM or by commenting here! I'll try to consider and answer every suggestion.
Commands/Configuration
- /tc help: Lists all commands.
- /tc toggle: Toggles the plugin for you. Just in case you made your home using lots of logs.
- /tc update: Checks for new updates, and updates if able.
- /tc reload: Reload config.yml changes.
- /tc setLimit <number>: Sets the limit of blocks this plugin can destroy at once. (-1 for unbounded)
- /tc setReplant <true/false>: Sets if trees should be replanted. True by default.
- /tc setInvincibleReplant <true/false>: Sets if replanted saplings should be unbreakable by survival players. False by default.
- /tc setAxeNeeded <true/false>: Sets if an axe is required for the plugin to work. True by default.
- /tc setDamageAxe <true/false>: Sets if the axe used is damage (only takes place if an axe is needed). True by default.
- /tc setBreakAxe <true/false>: Sets if the axe used can be broken (only takes place if an axe is needed and damaged). False by default.
- /tc setVipMode <true/false>: Sets if vip mode is on. False by default.
- /tc setNetherTrees <true/false>: Sets if the plugin works on the new nether "trees". False by default.
- /tc setStartActivated <true/false>: Sets if this plugin is activated for players when they enter the server. If false, players will need to use /tc toggle to activate it for themselves. True by default.
- /tc setJoinMsg <true/false>: Enables or disables the join message that remind players about /tc toggle. True by default.
- /tc setIgnoreLeaves <true/false>: Makes the plugin ignore or not the leaves aroung logs. False by default.
- /tc setCrouchPrevention <true/false/inverted>: Defines if crouching allows players to break logs individually. If set to inverted, players must crouch to break multiple logs with this plugin. False by default.
You may also use /treecap or /treecapitator as valid aliases for the /tc command.
Permission nodes
- cristreecapitator.user: Always required to take down trees fast.
- cristreecapitator.admin: Required to change options by commands.
- cristreecapitator.vip: Required to take down trees fast when Vip Mode is enabled.
How to Install
- Place your downloaded .jar file into YourServerDirectory/plugins/.
- Start or reload server.
- Then you may configure the plugin just the way you want, either using commands OR editing the config file and then typing /tc reload in the in-game chat (with cristreecapitator.admin permission/OP) or in the server console.
How to use VIP mode
VIP Mode enables an easy switch for the plugin. If VIP Mode is enabled regular users won't be able to use this plugin by default because they will also need an additional permission.
- Enable vip mode (/tc setVipMode true).
- Give 'cristreecapitator.vip' permission node to VIP players.
- It's already done! VIP players will be the only ones allowed to cut down trees faster! Don't worry, average players can still get wood, but the vanilla way.
How to add blocks as logs or leaves
You can configure other blocks to be detected as if they were logs or leaves, like the stripped logs or blocks from mods, or any block you want.
- Make sure you are using v6.4.0 or higher of this plugin.
- Check the name of the blocks in this link https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html.
- Go to the folder YourServerDirectory/plugins/CrisTreeCapitator where the configuration file is and open extra_logs.json or extra_leaves.json, and edit the files to include the blocks you want (as named in the previously mentioned link). Be careful to follow the format.
- Reload the server OR type /tc reload to apply the changes.
Keep it always up to date!
During startup you will receive a notification in the chat and the server console if the plugin needs to be updated. With a simple command you will be able to check new updates and update the plugin in-game.
I always recommend to keep the plugin up to date to make sure that you are benefiting from new features, general improvements and any bug fixes.
Compatibility with older versions.
If your server is running a Minecraft version older than 1.13, please click here to download v3.0.1 instead. It won't have all the advantages and performance of the latest version so please consider updating your server to at least Minecraft 1.13.
Need help?
Please feel free to contact me through DM or by commenting in this page. I do not have much free time to answer, but I will be sure to answer you as soon as possible. I will be happy to help on any issues that you are having, and consider every feature request that would make the plugin better for your server.
Future plans
My intention for the future of the plugin is to keep providing updates for new Minecraft versions, especially if there are any significant changes to the game like new trees or new features that would help this plugin's implementation. Additionally, I will provide support for any issues or bugs encountered by players, and I will consider any new features suggested as well. Please, feel free to let me know your feedback, good or bad.
Thank you for reading, and happy minecrafting!
does this work in singleplayer? (you only mentioned server and multiplayer) what do i put the file in to use it? (mods folder didnt read it) do modded trees break when using this?
question 1: is it possible to make them gradually break instead of instantly everything?
question 2: is it possible to make the drops go to the player inventory?
In reply to gamerlikegameryt: For the first question, no at the moment it breaks all in the same tick. Regarding the second, I tried to implement that years ago but it was a mess since it would pull every item close to the blocks being destroyed, and it was also quite laggy. So, the answer to both is: sorry but not at the moment.
In reply to Cristichi:
You could make the blocks drop nothing in the first place. Check the loot table for each block and give the items straight to the player's inventory. If the items won't fit, only then spawn them as item entities.
I mean, maybe there's a reason why you couldn't implement this feature. It's just my idea, but it may not be as easy to implement as I think.
I don't know how to set admins to use commands such as "/tc setCrouchPrevetion true" in the console of the server. It says: cristreecapitator.admin: (username) <---- HERE Does someone know how to?
In reply to dezervidar:
Basically, you need to find a plugin that allows you to give players the permissions needed, then you add the permissions (like cristreecapitator.admin)
Does this plugin ignore player placed blocks? I dont want to take out an entire house if its made of logs.
In reply to TehFishy_Dish:
Hi! No, there is no way to differentiate a block depending on what placed it, as they are identical. There might be a way to do it if the plugin was already running when the block was placed, but it would multiply the disk/RAM usage of the server by a huge amount.
Instead, you can use /tc toggle to have the plugin active only when you need it.
Great plugin, but I need help with something. People can cut trees down in areas where they shouldn't have perms, such like other people's towns (Towny plugin). How can I fix this? Thanks!
In reply to ricola4325:
Thank you for your kind words!
At the moment the way this plugin knows if a zone is "protected" is by checking if WorldGuard is running and asking it if it's protected.
I don't know if I'll have time to work on this, and I'm also working on another change (I'll have to finish that one first, otherwise my organization skills are going out the window), but please let me know which one of the different Townys you are using and the plugin and Minecraft versions, and I'll see if it is possible to add a check to it in my plugin.
Edit: To make it more clear, if WorldGuard is not running OR WorldGuard is not the plugin protecting the zone/block, then my plugin cannot know if it's protected. Some other protection plugins either use WorldGuard directly or communicates the protection to WorldGuard, so those work with my plugin. With that in mind, at the moment my plugin is blind to protection plugins that do not use WorldGuard.
In reply to Cristichi:
Thanks for the fast response! Im using "Towny-0.100.1.0" rn for Purpur 1.19.2. This is the plugin's page: https://github.com/TownyAdvanced/Towny. I hope it can be easy to fix, thanks!
In reply to ricola4325:
It looks like it's using Core Protect https://www.spigotmc.org/resources/coreprotect.8631/.
When I do what I'm trying to do now, I'll check if I can use it to check for protections done with it and if it works with Towny Advanced. Thank you again for the heads-up, and sorry for the inconvenience in your server.
In reply to Cristichi:
Hi, I wanted to know if you were able to fix the compatibility with Towny ^^
In reply to ricola4325:
Hi! Sorry, I'm not having much time due to the fact that I'm going on vacation for almost a month soon, so I did not have any time to do anything productive
In reply to Cristichi:
Ohh okay, no worries! Enjoy your vacation! ^^
A very good plugin. Add a configuration to change the damage that is caused to the axe. For example, in vanilla 1 log - 1 strength, then this value could be changed. For 1 log - 5 strength, etc.
In reply to tetanik_:
Thank you for the suggestion. I will consider it since it seems like a simple thing to add that won't affect anyone that would like to use the normal damage to the axe.
I'll let you know if I implement it! (And if I remember to come back here to tell you ofc)
Hey so I've been using this mod and its great, but I noticed that it dosen't work with adjusted trees like say for example, the terralith datapack. Would their be any way I can adjust the settings so it can treat the terralith ones as trees I can actually cut down? I know it should work but for some reason when I try to cut them, it acts like how it would work regularly!
Also is their anyway I can add like more options for the trees that it can replant? cause I tried it with cherry blossom trees and it dosen't replant them?
In reply to golisuine:
Hi!
Sorry for the late reply, I've been busy.
Yes, you can edit the files extra_logs.json and extra_leaves.json that are in the same folder as the configuration file. Blocks specified there will be treated as logs/leaves by the plugin no matter what (you can break big chunks of the world with that, be careful xD try not to include "DIRT" or something like that). You need to know how the blocks are called internally in the datapack. I have not tried it, but if the datapack is loaded when the plugin loads, then it will read those files and take the appropriate registered blocks. Please let me know if it works with the datapack (I would do it myself when I have time, but I don't know when that will be).
I downloaded the datapack and took a peek to see if I could find the new trees in the .json files, but I was not able to. Perhaps I didn't take enough time looking, or perhaps it uses other vanilla blocks that are not exactly logs (for instance, my plugin by default does not take "STRIPPED_" logs as logs since natural trees are not made of them. If that is the case, you can add them individually in the extra_logs.json file). So please, let me know what you are referring to when you say "adjusted trees" exactly and I will let you know if the plugin can do it and how.
Now regarding the replants, in my tests I was able to replant cherry blossom trees. I was actually quite keen on trying it when the new version was released by spigot, and it worked wonders because the plugin looks for any block that has "_LOG" in the internal name, and the cherry blossom logs have it. Same with the leaves "_LEAVES". I tried it again today and it was still working.
I also noticed that it was not working with Podzol, so perhaps those trees were in Podzol and therefore they could not be replanted. This was happening to every tree so I have to look into why this is happening. The system I built to recognise blocks in which trees can be replanted is not that simple, so the issue is in that part of my code. I'm sure of that. In my first tests I tried it only in dirt so I did not notice that. Please let me know if that could be the case with your cherry blossom trees as well.
Sorry for the long read and have a nice day!
In reply to Cristichi:
its more like the datapacks makes them grow like custom trees, so they still use existing blocks but their bigger and taller, their was some stripped trees in the some of the biomes I tested but I was mostly having a problem with the datapack not recognizing it as a regular tree even though it uses existing blocks, but Ill do a re-run and get back to you to see if maybe its something happening on my end. I appreciate the time you took to check to figure out the issue with me!