let ItemAttrEvent = Java.loadClass("net.neoforged.neoforge.event.ItemAttributeModifierEvent");

const attack_speed = {
  'cataclysm:the_incinerator': -0.8,
  'divinerpg:livicia_sword': 1000,
  
};

NativeEvents.onEvent(ItemAttrEvent, event => {
  let itemId = event.itemStack.id;
  let bonus = attack_speed[itemId];
  if (bonus == null) return;

  event.addModifier("minecraft:generic.attack_speed", {
    id: itemId + "_attack_mod",
    amount: bonus,
    operation: "add_value"
  }, "mainhand");
});

ItemEvents.modification(event => {
  for (let itemId in attack_speed) {
    event.modify(itemId, item => {
      item.setDamage(item.get("damage") * 3);
      item.setMaxDamage(item.get("max_damage") * 3);
    });
  }
});