Repository navigation
API
Enchanter's Bench exposes three events in the com.skd.enchantersbench.api.event package and a set of public helper classes. Events are posted on the NeoForge event bus (NeoForge.EVENT_BUS), not on the mod event bus.
Fired on the client and the server after the table builds its list of valid enchantments for the current item. Use it to add or remove entries.
| Member | Description |
|---|---|
getStack() |
The item being enchanted. |
getEnchantments() |
The mutable list of enchantment holders. |
setEnchantments(List<Holder<Enchantment>>) |
Replaces the list. |
Fired on the client and the server whenever the cost of one enchantment at a given number of levels is calculated. The modified cost is used by the table.
| Member | Description |
|---|---|
getEnchantment() |
The enchantment holder. |
getLevel() |
The number of levels the cost is being calculated for. |
getCost() |
The current cost. |
setCost(int) |
Changes the cost. |
getOriginalCost() |
The cost before any listener changed it. |
Client only. Fired when the info panel to the left of the advanced table screen is rendered. The info list can be modified in place to add or remove lines.
| Member | Description |
|---|---|
getGui() |
The AdvancedTableScreen being rendered. |
getInfo() |
The mutable list of Component lines. |
com.skd.enchantersbench.Blacklist provides static helpers:
blacklistItem(ResourceLocation)blacklistEnchantment(ResourceLocation)-
isItemBlacklisted(ItemStack)/isItemBlacklisted(Item) isEnchantmentBlacklisted(ResourceLocation)
The config-based entries are loaded into the same sets.
com.skd.enchantersbench.EnchantmentLogic contains the shared rules used by the table, including:
-
calculateNewEnchCost(Holder<Enchantment>, int)— the per-enchantment cost formula. -
getValidEnchantments(ItemStack, Level, BlockPos)— builds and filters the available enchantment list. -
isCurse(Level, Holder<Enchantment>),isWikedNight(Level)andisTreasuresAvailable(Level, BlockPos, BlockPos)— the availability rules for curses and treasure enchantments. -
getExperience(Player),addExperience(Player, int),removeExperience(Player, int),getExperienceForLevels(int)andgetLevelForExperience(int)— experience point helpers. -
getEnchantingPower(Level, BlockPos)— bookshelf power calculation. -
preventsArmorChange(ItemStack)— checks the prevent-armor-change enchantment effect. -
TEST_ENCHANTABILITY— the predicate used by the enchanting slot.
com.skd.enchantersbench.EnchantersConfig exposes static accessors for the current config values: baseCost(), costFactor(), treasureFactor(), curseFactor(), floatingBookPower(), blacklistedItems() and blacklistedEnchantments().
The mod registers two client-to-server payloads:
-
enchanters_bench:enchant— applies the selected enchantments. -
enchanters_bench:slider_update— updates the level selected for one enchantment.
These are implementation details; normal integrations should use the events above.
Enchanter's Bench is an unofficial port of Enchanting Plus (LGPL-3.0) by lclc98, Xkyouchoux, odininon and GnRSlash, maintained by Darkhax, with contributions from Jaredlll08, Shadows-of-Fire and translators. It is licensed under LGPL-3.0-or-later and is not affiliated with or endorsed by the original authors.