Download (437 KB)
For Luanti 5.4 and above

How do I install this?

Adds Enchanting Mechanics and API.

Features

  • does not add new tools/items, it's using MT API to change existing items instead
  • adds enchanting table
  • supports all registered tools with known tool groups: pickaxe, shovel, axe, sword, e.g. groups = {pickaxe = 1}
  • supports default:bookshelf or anything with group:bookshelf
  • supports all bows with group {bow = 1}
  • enchanting trade is for default:mese_crystal or anything with groups = {enchanting_trade = 1}
  • adds enchantability for all MT default tools, for custom tools the enchantability can be set in the item group, e.g. groups = {enchantability = 15}
  • uses only MT engine mechanics (e.g. tool capabilities)
  • enchanted items have detailed enchantments description/short description
  • mesh node model
  • mesh entity model and animations
  • tool texture will have enchanted glint
  • adds grind stone to remove enchantments (excluding curses)

How To

Enchanting Setup

For maximum level of enchantments you need maximum of 15 bookshelfs around the enchanting table, maximum of 2 blocks away. Maximum level is 30.

Enchanting Table

To be able to enchant items you need a trade item (by default default:mese_crystal or anything with groups = {enchanting_trade = 1}). Higher level enchantments costs more: level 1,2,3 costs mese crystals 1,2,3. When place item in the enchantment table item slot you can see three buttons with: - left side the trade cost amount - middle the enchantment you will get + maybe more enchantments - right side the base level for the enchantment (depends on how many bookshelfs are in reach) When you place item in the enchantment table trade slot you will see that some buttons are now enabled and can be clicked on - depends on trade amount available. The enchantments shown in the enchantment table will be always the same for item - this will change after you enchant an item. After enchanting an item a new enchantments will be shown.

Item Enchantability

All default tools have enchantability set. Higher enchantability = higher chance of getting better enchantments. Items enchantibility from worst to best: - stone - diamond - steel - wood / mese - bronze

Every Enchantment Explained

Sharpness

Increases melee damage.

groups: sword

Fortune

Increases the number and/or chances of specific item drops. Works with groups: stone, soil, sand, snowy, slippery, tree, leaves and all registered ores.

Incompatible: Silk Touch

groups: pickaxe, shovel, axe

Unbreaking

Increases the item's durability.

groups: any

Efficiency

Increases the player's mining speed. Also adds mining groupcaps to item, e.g. enchanted wood pickaxe can mine level 1 nodes (e.g. obsidian) after enchantment.

groups: pickaxe, shovel, axe

Silk Touch

Causes certain blocks to drop themselves as items instead of their usual drops when mined. Mods can prevent this behaviour with adding group { no_silktouch = 1 } to the nodes.

Incompatible: Fortune

groups: pickaxe, shovel, axe

Curse of Vanishing

Causes the item to disappear on death.

groups: any

Knockback

Increases knockback (players only).

groups: sword

Looting

Cause mobs to drop more items. This value is not used in the engine; it is the responsibility of the game/mod code to implement this.

Supported: mobs_monster, mobs_animal, animalia

groups: sword

Power

Increases arrow damage. Damage has to be calculated in the MOD where the bow comes from!

groups: bow

Punch

Increases arrow knockback. Knockback has to be calculated in the MOD where the bow comes from!

This can be obtained from tool meta:

groups: bow

Infinity

Prevents regular arrows from being consumed when shot. One arrow is needed INSIDE QUIVER to use a bow enchanted with Infinity. Fired arrows cannot be retrieved even if they are not fired from Quiver. Only set in item meta, logic for this has to be in the MOD where the bow comes from!

groups: bow

API

ItemStackMetaRef

  • get_float(key): Returns 0 if key not present. key can be enchantment id prefixed with is_, e.g. enchantment punch would have stored meta as is_punch. If returned value is bigger than zero then the value represents enchantment level bonus. See below fields for bow:
    • power Increase percentage
    • punch Multiplier
    • infinity If 1 then it is infinity enchanted
  • get_string(key): Returns "" if key not present. See below fields for all enchantments:
    • x_enchanting Serialized table with key/value pairs where: key is enchantment id and value is Enchantment definition

Enchantment definition

  • value number, Value of the enchantment based on level, e.g. multiplier, percentage/number increase...

example:

-- For simplicity assuming that all meta are present (biggger than zero or not "")
-- MODs have to add those checks individually

local itemstack_meta = itemstack:get_meta()

local power_value = itemstack_meta:get_float('is_power')
local punch_value = itemstack_meta:get_float('is_punch')
local infinity_value = itemstack_meta:get_float('is_infinity')

-- Or for list of all enchantments
local x_enchanting = minetest.deserialize(itemstack_meta:get_string('x_enchanting')) or {}
local power_enchantment = enchantments.power
local punch_enchantment = enchantments.punch
local infinity_enchantment = enchantments.infinity

-- Custom logic
local new_damage = damage + damage * (punch_enchantment.value / 100)
local new_knockback = knockback * punch_enchantment.value

if enchantments.infinity.value > 0 then
    -- Some logic for infinity
end

Reviews

Review

Do you recommend this mod?

  • I can't believe it

    This is not Minecraft. And yet this mod just works. I wish that there were an enchantment glint, but that is it, this mod is perfect. I will be playing with it in survival a lot more. And, yes, I understand the enchantment glint is not the dev's fault.

    0 comments
  • nice

    good job, working well. many kind of enchantment.

    1 comments
  • Awesome; Grindstone and books should be added

    This mod is really awesome and helped me in vanilla Minetest, but I would change some things.

    First of all, I would add a grindstone to remove all enchantings. EDIT: Added and works just awesome!
    Secondly, I would add the possibility to enchant books and to combine them with mese crystals or something else.
    And after all, I would make it less overpowered for stone and wood. We can just dig down tree trunks with a fortune 3 axe and we have infinited wood. Same with cobble.

    And please, after the update with the item overlay came out, make a compatibility layer or so to put that overlay on already enchanted items, because that would be really cool!

    0 comments
  • Super, aber sollte aktualisiert werden

    Die Mod ist wirklich super, doch wie der Titel schon sagt sollte sie aktualisiert werden. Da sehr viel mehr mods entwickelt/programmiert wurden fände ich es super wenn man hier auch mehr hinzufügt was man verzaubern kann. Z.B. gehören die „mese obsidian" und „mese obsidian engraved" tools quasi zu jedem server dazu, daher wäre es super wenn man diese tools ebenfalls verzaubern könnte!

    0 comments
  • Awesome mod that was so needed

    I love being able to enchant my weapons and items. This is a much needed mod. The one thing I would like to see is being able to put the enchantments in a book so items can have more than just 1 or 2 random enchantments. It would be nice to choose which ones you want through books. That and it would also make another use for books

    0 comments
  • Very awesome.

    Very great mod, good to have enchanting with modern code. One request: Could you make there be an api to make your own custom enchantments? Like maybe custom on_hit functions? I don't know what's all possible, but I'm definently setting this review to a huge thumbs up if an api is added. Thanks SaKeL, -StarNinjas

    0 comments

Used By