Added spider talisman

This commit is contained in:
Auxilor
2021-01-01 20:06:15 +00:00
parent 0344896561
commit a449da7bb5
2 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package com.willfp.talismans.talismans.talismans;
import com.willfp.talismans.talismans.Talisman;
import com.willfp.talismans.talismans.Talismans;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Spider;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.jetbrains.annotations.NotNull;
public class SpiderTalisman extends Talisman {
public SpiderTalisman() {
super("spider_talisman");
}
@Override
public void onMeleeAttack(@NotNull final Player attacker,
@NotNull final LivingEntity victim,
@NotNull final EntityDamageByEntityEvent event) {
if (!(victim instanceof Spider)) {
return;
}
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
}
}

View File

@@ -0,0 +1,27 @@
name: "Spider Talisman"
description: Deal 10% more damage to spiders.
enabled: true
obtaining:
# Recipes are left-right, top-bottom
# The first item is the top left, the second is top middle, and so on. The last is bottom right.
recipe:
- string
- string
- string
- string
- iron_block
- string
- string
- string
- string
general-config:
disabled-in-worlds: []
# Texture is base64, https://minecraft-heads.com has a list of skulls.
texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2Q1NDE1NDFkYWFmZjUwODk2Y2QyNThiZGJkZDRjZjgwYzNiYTgxNjczNTcyNjA3OGJmZTM5MzkyN2U1N2YxIn19fQ==
config:
percent-more-damage: 10