Better Mending
A plugin that allows players to repair their items with experience points, with customizable repair amounts and costs.
601
13
Equipment
Game Mechanics
Utility
Better Mending has been archived. Better Mending will not receive any further updates unless the author decides to unarchive the project.
Compatibility
Minecraft: Java Edition
1.19–1.19.3
1.18.x
1.17.x
1.16.x
Platforms
Bukkit
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Details
Changelog
Changes
- Replace the following block of code:
List<String> allowedEnchantments = getConfig().getStringList("allowedEnchantments");
for (Enchantment enchant : enchantments.keySet()) {
if (!allowedEnchantments.contains(enchant.getName())) {
// Enchantment is not allowed, cancel the event
interactEvent.setCancelled(true);
return;
}
}
with the following code:
if (enchantments.isEmpty()) {
// Item has no enchantments, cancel the event
interactEvent.setCancelled(true);
return;
}
List<String> allowedEnchantments = getConfig().getStringList("allowedEnchantments");
boolean hasAllowedEnchantment = false;
for (Enchantment enchant : enchantments.keySet()) {
if (allowedEnchantments.contains(enchant.getName())) {
hasAllowedEnchantment = true;
break;
}
}
if (!hasAllowedEnchantment) {
// Item does not have any allowed enchantments, cancel the event
interactEvent.setCancelled(true);
return;
}
This change modifies the onPlayerInteract
method to check if the item being repaired has at least one allowed enchantment, rather than checking if all of its enchantments are allowed. If the item has at least one allowed enchantment, the player is allowed to use experience points to repair the item. If the item does not have any allowed enchantments, the event is cancelled and the player is not allowed to use experience points to repair the item.
Files
Metadata
Release channel
AlphaVersion number
1.0.6-1.19.3-paperLoaders
Game versions
1.19–1.19.3Downloads
52Publication date
January 8, 2023 at 5:21 PMPublisher
laika
Owner