AutoReplantCrop
🌐 English
版本: 1.0.1 | API: Paper 26.1+ (Java 25) | 作者: Duong2012G
许可协议: Apache-2.0 | 链接: Modrinth
单次右键即可收获并重新种植。开箱即用,所有玩家均可使用——无需权限、工具或额外设置。 只需右键点击已成熟的作物:它会被立即收获并重新种植,而用于重新种植的种子取自该作物自身的掉落物。对于服务器管理员来说,需要锄头、忽略潜行、将掉落物直接放入背包以及按世界/按作物切换等功能均为可选设置。
功能
| 功能 |
描述 |
| 一键收获与重植 |
在主手右键点击已成熟的作物,它将被收获并重置为生长阶段 0。作物方块永远不会被移除再放置,因此其状态(例如可可豆的朝向)得以保留。 |
| 从掉落物中扣除种子成本 |
从作物自身的掉落物中扣留一粒种子用于重新种植。如果作物通常掉落 3 粒种子,你将获得 2 粒,第 3 粒会被种下。不会凭空创造物品。 |
| 支持的作物 |
小麦、胡萝卜、马铃薯、甜菜根、下界疣和可可。每种作物都可以在 crops 配置项中单独关闭。重新种植的物品:小麦种子、胡萝卜、马铃薯、甜菜种子、下界疣、可可豆。 |
| 幸运魔咒支持 |
掉落物的计算以你主手中的物品作为掉落工具进行,因此幸运魔咒会增加掉落物,就像破坏作物时一样(仍会保留一粒种子用于重新种植)。可通过 fortune-support 配置项关闭此功能。 |
| 种子回退机制 |
某些作物可能完全不掉落种子(例如甜菜根)。启用 take-seed-from-inventory 后,系统会从你的背包(主背包、快捷栏或副手槽)中取出一件匹配的物品。优先使用普通种子;仅在无其他可用物品时使用带有名称/描述的物品。如果任何地方都没有种子,则根据 harvest-without-seed 配置决定:是收获但不重新种植,还是保持作物原样不动(动作栏提示将显示玩家客户端语言中的物品名称)。 |
| 未成熟作物绝不触碰 |
仅对已成熟的作物生效。骨粉、方块放置以及其他所有原版交互在作物仍在生长时均正常工作。 |
| 安全的点击处理 |
一旦点击了已成熟的作物,无论结果如何(成功、被保护插件拒绝、无种子),该点击即归插件所有,从而防止手持物品(末影珍珠、水桶、方块等)被意外使用。客户端随后发送的后续点击——副手方块点击(一次,在 250 毫秒内)和“在空中使用物品”点击(在 100 毫秒内)——也会被吞没,这样副手中的骨粉、方块或投掷物就不会浪费在重新种植的作物上。 |
| 保护插件支持 |
在任何更改发生之前,为玩家触发一个标准的 BlockBreakEvent,因此通过该事件工作的保护插件可以取消它。如果被取消,作物将保持原样。种子检查在该事件之前运行,因此被拒绝的收获在其他插件看来绝不会像真实的破坏行为。 |
| 类似破坏的行为 |
一旦破坏事件完成,作物要么被重新种植,要么被移除——绝不会留下完全成熟的作物。完整的收获过程经过 BlockDropItemEvent,重新种植的种子取自之后实际交付的内容,因此掉落倍率插件可以看到并放大真实的收获量。经验值会在破坏事件中生成,并且会统计原版的“挖掘方块数”统计数据。 |
| 兼容掉落插件 |
如果另一个插件在破坏事件中调用 setDropItems(false)(自定义掉落、自动拾取等),本插件将不添加任何原版掉落物。重新种植时,种子将从背包中获取(此类插件通常将物品放在那里),或者作物像正常破坏一样被移除。 |
| 仅在合法位置重新种植 |
作物仅在原版可以种植的地方重新种植(土壤/原木仍存在,作物有足够的光照)。否则,它将像正常破坏一样被收获并移除,你保留所有掉落物。 |
| 按玩家切换 |
/arc toggle 开关为自己禁用/启用该功能。选择保存在玩家数据中,重启和重新登录后依然有效。/arc status 显示当前状态。 |
| 管理员工具 |
/arc toggle <player> 和 /arc status <player>(也可从控制台执行)管理其他在线玩家。 |
| 游戏模式 |
生存模式:正常行为。创造模式:免费重新种植作物且不掉落任何物品,如同原版创造模式下的破坏行为。冒险模式和旁观模式:忽略。 |
| 视觉效果 |
手臂摆动、方块破坏粒子效果,以及作物自身的原版破坏和种植声音(particles, sounds)。 |
| 现代化消息格式 |
每条消息都支持 MiniMessage(<green>, <gradient:...>, <click:...>)以及传统的 & 代码和 &#RRGGBB 十六进制颜色。消息在配置文件加载时解析一次。 |
| 世界限制 |
disabled-worlds,按世界名称(不区分大小写)禁用。 |
| Folia 支持 |
声明支持 Folia。所有内容都在拥有被点击方块的区域内运行,共享状态是线程安全的,涉及其他玩家的命令通过实体调度器执行。 |
| 轻量级 |
无依赖项,无计划任务,无数据文件。监听器仅在玩家右键点击受支持的作物时工作。 |
服务器管理员的可选设置
| 设置项 |
作用 |
需要锄头 (require-hoe) |
仅当主手持有锄头时生效(通过原版锄头物品标签检测,因此模组添加的或未来的锄头也能使用)。默认关闭。 |
潜行时忽略 (ignore-while-sneaking) |
潜行+右键的行为与原版一致,方便在作物旁边放置方块。默认关闭。 |
掉落物进入背包 (drops-to-inventory) |
掉落物直接进入玩家背包;无法容纳的部分则掉落在地面上。默认关闭。 |
各作物开关 (crops) |
分别启用或禁用小麦、胡萝卜、马铃薯、甜菜根、下界疣和可可豆。 |
要求
- Minecraft 26.1 或更高版本的 Paper 服务器(基于 26.1.2 API 编译)。基于 Paper 的分叉服如 Purpur 使用相同的 API。
plugin.yml 中声明了 api-version: 26.1。
- Java 25(Minecraft 26.x 本身所需)
- 仅限 Paper API:不支持 Spigot。Folia 被声明为兼容(详见兼容性说明)。
安装
- 将
AutoReplantCrop-1.0.1.jar 放入服务器的 plugins/ 文件夹。
- 启动一次服务器;此时会生成
plugins/AutoReplantCrop/config.yml。
- 编辑该文件并使用
/arc reload 应用更改(无需重启服务器)。
从 1.0.0 升级时会保留您的 config.yml:缺失的配置键会自动回退到新默认值,使用 & 颜色代码的消息也能继续正常工作。
使用方法
用主手右键点击完全成熟的作物。这就是全部操作——默认情况下不需要潜行,也不需要特殊工具。
仅当满足以下所有条件时,自动补种才会触发:
- 玩家拥有
autoreplantcrop.use 权限(默认所有人都有),且未使用 /arc toggle 将其关闭
- 当前世界未在
disabled-worlds 列表中列出,且该作物在 crops 中已启用
- 作物处于完全成熟状态,且玩家处于生存模式或创造模式
- 玩家没有潜行(仅在
ignore-while-sneaking: true 时生效)且手持锄头(仅在 require-hoe: true 时生效)
- 有可用的种子(来自掉落物或背包),或者
harvest-without-seed 设置为 true
- 玩家自己的破坏行为未被保护插件取消
以小麦为例:
|
小麦 |
小麦种子 |
| 正常破坏会掉落 |
1 |
3 |
| AutoReplantCrop 给你 |
1 |
2(其中 1 粒种子被重新种植) |
在创造模式下,作物也会被重新种植,但不会掉落任何物品。
命令与权限
| 命令 |
权限 |
描述 |
/arc toggle |
autoreplantcrop.use (默认: 所有人) |
开启/关闭你自己的自动补种功能。已保存——重启后依然有效。 |
/arc status |
autoreplantcrop.use |
显示你的自动补种功能是开启还是关闭。 |
/arc toggle <player> |
autoreplantcrop.admin (默认: op) |
开启/关闭其他在线玩家的自动补种功能。可从控制台执行。 |
/arc status <player> |
autoreplantcrop.admin |
显示其他在线玩家的状态。可从控制台执行。 |
/arc reload |
autoreplantcrop.admin |
重新加载 config.yml。 |
/arc 命令本身需要 autoreplantcrop.use 权限,默认所有人都有。若要从某个组移除该功能,请在你的权限插件中将 autoreplantcrop.use 设为 false。额外的参数(例如 /arc toggle a b)将显示用法提示而不是执行命令。
配置
所有内容位于 plugins/AutoReplantCrop/config.yml。
| 键名 |
默认值 |
范围 |
描述 |
settings.require-hoe |
false |
|
玩家必须在主手持有锄头。 |
settings.ignore-while-sneaking |
false |
|
潜行+右键使用原版行为(不收获)。 |
settings.fortune-support |
true |
|
将主手物品作为获取掉落物的工具,使幸运附魔增加掉落数量。如果为 false,掉落量始终为未附魔时的固定数量。 |
settings.drops-to-inventory |
false |
|
将掉落物直接放入背包(溢出部分掉落在地面上)。 |
settings.take-seed-from-inventory |
true |
|
当作物未掉落种子时,从玩家背包或副手中取出一枚匹配的物品。 |
settings.harvest-without-seed |
true |
|
当任何地方都没有可用种子时:true = 像正常破坏一样收获(不重新种植),false = 保持作物不动。 |
settings.particles |
true |
|
收获时显示方块破坏粒子效果。 |
settings.sounds |
true |
|
播放作物的原版破坏和种植音效。 |
settings.disabled-worlds |
[] |
|
在此处列出的世界中禁用此功能(按名称匹配,不区分大小写)。 |
crops.wheat / .carrots / .potatoes / .beetroots / .nether_wart / .cocoa |
true |
|
启用或禁用每种作物。 |
messages.* |
见文件 |
|
prefix, toggle-on, toggle-off, toggle-other-on, toggle-other-off, status-on, status-off, status-other-on, status-other-off, reloaded, no-permission, players-only, player-not-found, usage, no-seed。支持 MiniMessage 或传统 & / &#RRGGBB 代码;空字符串可隐藏消息。占位符:{player}, {seed}(物品名称,由每位玩家的客户端翻译)。 |
种子选择逻辑:插件首先在作物的掉落物中寻找用于重新种植的物品并预留一枚。如果掉落物中没有,它会查看玩家的背包和副手(当 take-seed-from-inventory 开启时)。如果仍然失败,则由 harvest-without-seed 决定后续操作。
种子是从掉落物中取出的,之后才让其他插件对 BlockDropItemEvent 发表意见:普通的种子优先,只有在没有其他东西的情况下才会考虑特殊命名或有 Lore 的种子。如果另一个插件拿走了掉落物导致没有剩余种子,插件会从背包中取出一枚作为替代,最后手段则是像正常破坏一样移除作物——重新种植绝不会免费。如果 BlockDropItemEvent 被取消(例如由禁止物品掉落的区域插件引起),没有人会收到收获物,因此种子被视为已从丢弃的掉落物中取出,作物会被重新种植;如果有背包中的种子,则优先使用它。
消息:前缀作为同级元素连接到文本,因此像 &a&l[ARC] 这样的前缀不会对其后的消息进行重着色或加粗。包含传统颜色代码(&a、&l、&#ff8800)的消息会被读取为传统文本,其他所有消息则被读取为 MiniMessage。请勿在一条消息中混合使用这两种样式。
示例:
# 仅允许手持锄头时右键重新种植,并保留潜行放置方块的功能
settings:
require-hoe: true
ignore-while-sneaking: true
# 将所有掉落物直接收集到背包中
settings:
drops-to-inventory: true
# 永不销毁无法重新种植的作物(例如未掉落种子的甜菜根)
settings:
harvest-without-seed: false
# 渐变前缀
messages:
prefix: "<gradient:#55ff55:#00aa00>AutoReplantCrop</gradient> <dark_gray>»</dark_gray> "
缺失的键会自动回退到内置默认值,因此旧版 config.yml 在更新后仍能正常工作。
兼容性说明
- 在执行任何操作之前,插件会为玩家和作物调用常规的
BlockBreakEvent。因此,针对防破坏方块的保护区域与领地插件(WorldGuard、GriefPrevention、Lands、Towny 等)会自动生效。
- 掉落物通过常规的
BlockDropItemEvent 生成,因此挂钩该事件的插件(如掉落倍增器、自动拾取/念力类插件)可以查看并修改它们。
- Folia: 已声明支持,配置项为
folia-supported: true。代码是依据 Folia 的规则编写的(仅触碰点击方块的区域,无全局状态且非线程安全,其他玩家通过实体调度器处理),但尚未在 Folia 服务器上运行过——如有任何问题,请报告。
- 本插件没有任何硬性或软性依赖。
已知限制
BlockBreakEvent 是一个模拟破坏事件:作物方块本身保留在原位,仅重置为生长阶段 0。监听该事件的插件(日志记录、统计、技能系统)会将其视为完全成熟作物的正常破坏。由于重新种植不会触发 BlockPlaceEvent,回滚插件恢复的是成熟的作物,而非重新种植的作物。
- “A Seedy Place” 成就(及其他“放置方块”触发条件)无法通过重新种植触发:Bukkit API 没有提供授予这些成就的方式。
- 如果其他插件取消了
BlockDropItemEvent 并将掉落物分发到玩家背包以外的地方(例如虚拟背包),则无法从背包中回收重新种植的种子,导致此次重新种植免费。
- 工具不会受到耐久度损耗。这与原版行为一致,即瞬间破坏方块(如作物)不会磨损工具。
- 如果背包中的种子后备方案仅找到特殊物品(自定义名称、描述或其他物品数据),则会使用其中之一,因为原版接受任何种子物品进行种植。普通种子始终优先使用。
- 不支持甜浆果丛(原版已可收获)、火炬花、猪笼草、西瓜/南瓜茎以及甘蔗。
从源代码构建
要求:JDK 25 和 Maven 3.9+。
mvn clean package
生成的插件文件位于 target/AutoReplantCrop-1.0.1.jar。Paper API 版本由 pom.xml 中的 paper.api.version 属性决定。
更新日志
请参阅 CHANGELOG.md。
AutoReplantCrop
🌐 English
Version: 1.0.1 | API: Paper 26.1+ (Java 25) | Author: Duong2012G
License: Apache-2.0 | Link: Modrinth
Harvest and replant with a single right-click. Out of the box every player can use it — no permissions,
tools or extra setup get in the way. Just right-click a fully grown crop: it is harvested and planted again
at once, and the seed needed for the replant is taken from the crop's own drops. Requiring a hoe, ignoring
sneaking, sending drops straight to the inventory and per-world / per-crop switches are optional settings
for server admins.
Features
| Feature |
Description |
| One-click harvest and replant |
Right-click a fully grown crop with your main hand and it is harvested and reset to growth stage 0 in place. The crop block is never removed and placed again, so its state (for example the facing of cocoa pods) is kept. |
| Seed cost taken from the drops |
One seed is held back from the crop's own drops and used for the replant. If a crop would normally drop 3 seeds, you receive 2 and the third one is planted. Nothing is created out of thin air. |
| Supported crops |
Wheat, carrots, potatoes, beetroots, nether wart and cocoa. Each one can be switched off in crops. Replant items: wheat seeds, carrot, potato, beetroot seeds, nether wart, cocoa beans. |
| Fortune |
Drops are calculated with the item in your main hand as the loot tool, so Fortune increases the drops exactly like when breaking the crop (one seed is still kept for the replant). Switch off with fortune-support. |
| Seed fallback |
Some crops can drop no seed at all (for example beetroots). With take-seed-from-inventory one matching item is taken from your inventory — main inventory, hotbar or off-hand. Plain seeds are used first; named / lore items only when nothing else is available. If there is no seed anywhere, harvest-without-seed decides: harvest without replanting, or leave the crop untouched (an action-bar hint tells the player, with the item name shown in the player's own client language). |
| Immature crops are never touched |
Only fully grown crops react. Bone meal, block placement and every other vanilla interaction keep working on crops that are still growing. |
| Safe click handling |
Once a fully grown crop is clicked, the click belongs to the plugin whatever the outcome (success, protection denial, no seed), so the held item (ender pearl, water bucket, block...) is never used by accident. The follow-up clicks the client sends right after — the off-hand block click (once, within 250 ms) and a "use item in the air" click (within 100 ms) — are swallowed too, so bone meal, blocks or throwables in the off-hand are not wasted on the replanted crop. |
| Protection plugin support |
Fires a normal BlockBreakEvent for the player before anything changes, so protection plugins that work through that event can cancel it. If it is cancelled, the crop is left exactly as it was. The seed check runs before that event, so a refused harvest never looks like a real break to other plugins. |
| Break-like behaviour |
Once the break event went through, the crop is always either replanted or removed — it is never left fully grown. The full harvest goes through BlockDropItemEvent and the replant seed is taken from what is really delivered afterwards, so drop-multiplier plugins see and multiply the real harvest. Experience set on the break event is spawned, and the vanilla blocks mined statistic is counted. |
| Drop-plugin friendly |
If another plugin calls setDropItems(false) on the break event (custom drops, auto-pickup...), the plugin adds no vanilla drops. The replant then takes its seed from the inventory (where such plugins usually put the items), or the crop is removed like a normal break. |
| Valid replanting only |
A crop is only replanted where vanilla could plant it (soil / log still there, enough light for crops). Otherwise it is harvested and removed like a normal break and you keep every drop. |
| Per-player toggle |
/arc toggle switches the feature off/on for yourself. The choice is saved on the player and survives restarts and relogs. /arc status shows the current state. |
| Admin tools |
/arc toggle <player> and /arc status <player> (also from the console) manage other online players. |
| Game modes |
Survival: normal behaviour. Creative: the crop is replanted for free and nothing drops, like vanilla creative breaking. Adventure and Spectator: ignored. |
| Effects |
Arm swing, block-break particles, and the crop's own vanilla break and plant sounds (particles, sounds). |
| Modern messages |
Every message supports MiniMessage (<green>, <gradient:...>, <click:...>) as well as legacy & codes and &#RRGGBB hex colours. Messages are parsed once when the config loads. |
| World restrictions |
disabled-worlds, by world name (case-insensitive). |
| Folia |
Declared Folia-supported. Everything runs on the region that owns the clicked block, shared state is thread-safe, and commands that touch other players go through the entity scheduler. |
| Lightweight |
No dependencies, no scheduled tasks, no data files. The listener only does work when a player right-clicks a supported crop. |
Optional settings for server admins
| Setting |
What it does |
Require a hoe (require-hoe) |
Only works while holding a hoe in the main hand (checked through the vanilla hoe item tag, so modded / future hoes work). Off by default. |
Ignore while sneaking (ignore-while-sneaking) |
Sneak + right-click behaves like vanilla, which is handy for placing blocks next to crops. Off by default. |
Drops to inventory (drops-to-inventory) |
Drops go straight into the player's inventory; whatever does not fit is dropped on the ground. Off by default. |
Per-crop switches (crops) |
Enable or disable wheat, carrots, potatoes, beetroots, nether wart and cocoa individually. |
Requirements
- A Paper server on Minecraft 26.1 or newer (compiled against the 26.1.2 API). Paper-based forks such as Purpur use the same API.
plugin.yml declares api-version: 26.1.
- Java 25 (required by Minecraft 26.x itself)
- Paper API only: Spigot is not supported. Folia is declared supported (see Compatibility notes).
Installation
- Put
AutoReplantCrop-1.0.1.jar into your server's plugins/ folder.
- Start the server once;
plugins/AutoReplantCrop/config.yml is created.
- Edit it and apply changes with
/arc reload (no restart needed).
Upgrading from 1.0.0 keeps your config.yml: keys that are missing fall back to the new defaults
automatically, and messages that use & colour codes keep working.
How to use
Right-click a fully grown crop with your main hand. That is all — no sneaking and no special tool needed
by default.
Auto-replant only triggers when all of these hold:
- the player has
autoreplantcrop.use (everyone does by default) and has not used /arc toggle to switch it off
- the world is not listed in
disabled-worlds and the crop is enabled in crops
- the crop is fully grown and the player is in Survival or Creative mode
- the player is not sneaking (only when
ignore-while-sneaking: true) and holds a hoe (only when require-hoe: true)
- a seed is available (drops or inventory), or
harvest-without-seed is true
- the player's own break is not cancelled by a protection plugin
Example with wheat:
|
Wheat |
Wheat seeds |
| A normal break would drop |
1 |
3 |
| AutoReplantCrop gives you |
1 |
2 (1 seed is planted again) |
In Creative mode crops are replanted too, but nothing drops.
Commands & permissions
| Command |
Permission |
Description |
/arc toggle |
autoreplantcrop.use (default: everyone) |
Turn auto-replant on/off for yourself. Saved — it survives restarts. |
/arc status |
autoreplantcrop.use |
Show whether auto-replant is on for you. |
/arc toggle <player> |
autoreplantcrop.admin (default: op) |
Turn auto-replant on/off for another online player. Works from the console. |
/arc status <player> |
autoreplantcrop.admin |
Show the state for another online player. Works from the console. |
/arc reload |
autoreplantcrop.admin |
Reload config.yml. |
The /arc command itself requires autoreplantcrop.use, which everyone has by default. To take the feature away
from a group, set autoreplantcrop.use to false for that group in your permissions plugin. Extra arguments
(for example /arc toggle a b) show the usage message instead of running.
Configuration
Everything lives in plugins/AutoReplantCrop/config.yml.
| Key |
Default |
Range |
Description |
settings.require-hoe |
false |
|
Player must hold a hoe in the main hand. |
settings.ignore-while-sneaking |
false |
|
Sneaking + right-click uses vanilla behaviour (no harvest). |
settings.fortune-support |
true |
|
Use the main-hand item as the loot tool so Fortune increases the drops. If false, drops are always the un-enchanted amounts. |
settings.drops-to-inventory |
false |
|
Put drops straight into the inventory (overflow is dropped on the ground). |
settings.take-seed-from-inventory |
true |
|
When the crop dropped no seed, take one matching item from the player's inventory or off-hand. |
settings.harvest-without-seed |
true |
|
When no seed is available anywhere: true = harvest like a normal break (no replant), false = leave the crop untouched. |
settings.particles |
true |
|
Block-break particles on harvest. |
settings.sounds |
true |
|
The crop's vanilla break and plant sounds. |
settings.disabled-worlds |
[] |
|
Worlds (by name, case-insensitive) where the feature is disabled. |
crops.wheat / .carrots / .potatoes / .beetroots / .nether_wart / .cocoa |
true |
|
Enable or disable each crop. |
messages.* |
see file |
|
prefix, toggle-on, toggle-off, toggle-other-on, toggle-other-off, status-on, status-off, status-other-on, status-other-off, reloaded, no-permission, players-only, player-not-found, usage, no-seed. MiniMessage or legacy & / &#RRGGBB codes; an empty string hides the message. Placeholders: {player}, {seed} (the item name, translated by each player's client). |
How the seed is chosen: the plugin first looks for the replant item in the crop's drops and holds one back. If the
drops contain none, it looks in the player's inventory and off-hand (when take-seed-from-inventory is on). If that
fails too, harvest-without-seed decides what happens.
The seed is taken from the drops after other plugins had their say on BlockDropItemEvent: plain seeds first, special named / lore seeds only if nothing else is there. If another plugin took the drops so that no seed is left, the plugin takes one from the inventory instead, and as a last resort removes the crop like a normal break — a replant is never free. If BlockDropItemEvent is cancelled (for example by a region that forbids item drops), nobody receives the harvest, so the seed counts as taken from the discarded drops and the crop is replanted; a seed from the inventory is used first when there is one.
Messages: the prefix is joined to the text as a sibling, so a prefix like &a&l[ARC] does not recolour or embolden the message after it. A message that contains legacy codes (&a, &l, &#ff8800) is read as legacy text, every other message
is read as MiniMessage. Do not mix both styles inside one message.
Examples:
# Only allow right-click replanting with a hoe in hand, and keep sneaking free for placing blocks
settings:
require-hoe: true
ignore-while-sneaking: true
# Collect everything straight into the inventory
settings:
drops-to-inventory: true
# Never destroy a crop that cannot be replanted (e.g. a beetroot that dropped no seed)
settings:
harvest-without-seed: false
# Gradient prefix
messages:
prefix: "<gradient:#55ff55:#00aa00>AutoReplantCrop</gradient> <dark_gray>»</dark_gray> "
Missing keys fall back to the built-in defaults automatically, so an older config.yml keeps working after an update.
Compatibility notes
- Before changing anything, the plugin calls a regular
BlockBreakEvent for the player and the crop. Region and claim plugins that protect against block breaking (WorldGuard, GriefPrevention, Lands, Towny...) therefore apply automatically.
- Drops are spawned through a regular
BlockDropItemEvent, so plugins that hook that event (drop multipliers, auto-pickup / telekinesis style plugins) can see and change them.
- Folia: declared supported with
folia-supported: true. The code was written for Folia's rules (only the clicked block's region is touched, no global state without thread-safety, other players are handled through the entity scheduler), but it has not been run on a Folia server yet — please report any problem.
- The plugin has no hard or soft dependencies.
Known limitations
- The
BlockBreakEvent is a simulated break: the crop block itself stays in place and is only reset to growth stage 0. Plugins that listen to the event (logging, statistics, skills) see it as a normal break of a fully grown crop. No BlockPlaceEvent is fired for the replant, so a rollback plugin restores the grown crop rather than the replanted one.
- The A Seedy Place advancement (and other "placed a block" triggers) cannot be triggered by a replant: the Bukkit API has no way to award them.
- If another plugin cancels
BlockDropItemEvent and hands the drops out somewhere other than the player's inventory (a virtual backpack, for example), the replant seed cannot be recovered from the inventory and that replant is free.
- The tool takes no durability damage. This matches vanilla, where breaking instantly-breaking blocks such as crops does not wear tools.
- If the inventory seed fallback finds only special items (custom name, lore or other item data), one of them is used, because vanilla accepts any seed item for planting. Plain seeds are always used first.
- Sweet berry bushes (already harvestable in vanilla), torchflowers, pitcher plants, melon / pumpkin stems and sugar cane are not supported.
Building from source
Requirements: JDK 25 and Maven 3.9+.
mvn clean package
The finished plugin is written to target/AutoReplantCrop-1.0.1.jar. The Paper API version is the
paper.api.version property in pom.xml.
Changelog
See CHANGELOG.md.
评论 0
登录后参与评分
还没有评论,来抢沙发吧