Add item enchantments field

This commit is contained in:
Misode
2019-06-24 16:42:03 +02:00
parent 45001a3204
commit fa2b869bea
3 changed files with 97 additions and 9 deletions

View File

@@ -343,12 +343,6 @@ function addModifier(el) {
invalidated();
}
function removeModifier(el) {
let index = parseInt($(el).closest('.modifier').attr('data-index'));
getSuperParent(el).modifiers.splice(index, 1);
invalidated();
}
function addModifierSlot(el) {
let modifier = getParent(el);
if (!modifier.slot) {
@@ -586,3 +580,15 @@ function updateChancesField(el) {
}
invalidated();
}
function addConditionEnchantment(el) {
let condition = getParent(el);
if (!condition.enchantments) {
condition.enchantments = [];
}
condition.enchantments.push({
enchantment: 'minecraft:silk_touch',
level: 1
});
invalidated();
}