Knight Blade
Right click to gain the buffs of a Draugr Knight
← Back to main
Code Block:
function check_item(item, item_name, custom_name, customId){
return (
item &&
item.name === item_name &&
item.attributes.customDisplayName === custom_name &&
item.attributes.customAttributes.weaponId === customId
);
}
api.giveItem(myId, "Knight Sword", 1, {customDisplayName: "Knight Blade",customDescription: "Right click to Get the daugr knight buffs", customAttributes: {weaponId: 1, "enchantmentTier":"Tier 5", enchantments: {"Damage":1}}})
function onPlayerAltKnight(aId){
held = api.getHeldItem(aId)
if(check_item(held,"Knight Sword","Knight Blade",1) && !api.getEffects(aId).includes("Daugr Cooldown")){
api.applyEffect(aId, "Daugr Cooldown", 30000, {icon: "Cyan Wool"})
api.applyEffect(aId, "Speed", 10000, {inbuiltLevel: 2})
api.applyEffect(aId, "Jump Boost", 10000, {inbuiltLevel: 1})
api.applyEffect(aId, "Damage", 10000, {inbuiltLevel: 1})
}else{
return
}
}
World Code:
onPlayerAltAction = (playerId, x, y, z, block, targetEId) => {
onPlayerAltKnight(playerId)
}