com.sucy.skill.dynamic.trigger.SkillTakenTrigger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proskillapi Show documentation
Show all versions of proskillapi Show documentation
A Minecraft Bukkit plugin aiming to provide an easy code API and skill editor for all server owners to
create unique and fully custom classes and skills.
package com.sucy.skill.dynamic.trigger;
import com.sucy.skill.api.Settings;
import com.sucy.skill.api.event.SkillDamageEvent;
import org.bukkit.entity.LivingEntity;
import java.util.Map;
/**
* ProSkillAPI © 2023
* com.sucy.skill.dynamic.trigger.BlockBreakTrigger
*/
public class SkillTakenTrigger extends SkillTrigger {
/**
* {@inheritDoc}
*/
@Override
public String getKey() {
return "TOOK_SKILL_DAMAGE";
}
/**
* {@inheritDoc}
*/
@Override
public LivingEntity getCaster(final SkillDamageEvent event) {
return event.getTarget();
}
/**
* {@inheritDoc}
*/
@Override
public LivingEntity getTarget(final SkillDamageEvent event, final Settings settings) {
return isUsingTarget(settings) ? event.getDamager() : event.getTarget();
}
/**
* {@inheritDoc}
*/
@Override
public void setValues(final SkillDamageEvent event, final Map data) {
data.put("api-taken", event.getDamage());
}
}