Added EXPERIENCE_BLOCK_BREAK

This commit is contained in:
Brianna 2019-08-05 12:57:06 -04:00
parent 818123f70f
commit a53bd7398d
3 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,8 @@ public enum TriggerType {
STATIC_EFFECT,
BLOCK_BREAK,
REPEATING,
EXPERIENCE_BLOCK_BREAK,
REPEATING, //TODO: Figure out what this is.
RIGHT_CLICK,
LEFT_CLICK
}

View File

@ -67,6 +67,8 @@ public class PlayerListener implements Listener {
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onBlockBreak(BlockBreakEvent event) {
instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, BLOCK_BREAK);
if (event.getExpToDrop() != 0)
instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, EXPERIENCE_BLOCK_BREAK);
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)

View File

@ -20,9 +20,9 @@ item-whitelist:
effects:
MODIFY_EXP:
# Chance that this will happen
chance: "5 * {level}"
chance: "20 * {level}"
# The trigger that will fire this effect
trigger: BLOCK_BREAK
trigger: EXPERIENCE_BLOCK_BREAK
# What player should the effect be ran on: USER/OPPONENT.
who: USER
# Amount of EXP to add