Added nether talisman

This commit is contained in:
Auxilor
2021-01-01 20:12:04 +00:00
parent 93be0566d1
commit 8434eac161
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.World;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.jetbrains.annotations.NotNull;
public class NetherTalisman extends Talisman {
public NetherTalisman() {
super("nether_talisman");
}
@Override
public void onMeleeAttack(@NotNull final Player attacker,
@NotNull final LivingEntity victim,
@NotNull final EntityDamageByEntityEvent event) {
if (attacker.getWorld().getEnvironment() != World.Environment.NETHER) {
return;
}
event.setDamage(event.getDamage() * (1 + (this.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
}
}

View File

@@ -0,0 +1,27 @@
name: "Nether Talisman"
description: Deal 10% more damage in the nether.
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:
- netherrack
- netherrack
- netherrack
- netherrack
- gold_block
- netherrack
- netherrack
- netherrack
- netherrack
general-config:
disabled-in-worlds: []
# Texture is base64, https://minecraft-heads.com has a list of skulls.
texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDUwMDI5MmY0YWZlNTJkMTBmMjk5ZGZiMjYwMzYzMjI4MzA0NTAzMzFlMDAzMDg0YmIyMjAzMzM1MzA2NjRlMSJ9fX0=
config:
percent-more-damage: 10