Here is the code:
const soulSpeed = new Enchantment("soul_speed", 2)
const item = player.getComponent('equipment_inventory').getEquipmentSlot("feet").getItem();
if (!item) return;
const item_enchants = item.getComponent("enchantments").enchantments;
if (!item_enchants) return;
item_enchants.addEnchantment(soulSpeed);
I get no errors, it just doesn't work.