Interface RuneApplicable
public interface RuneApplicable
Defines items that can be applied with runes.
Default rune-applicable items are defined in Rune.DEFAULT_APPLICABLES,
including but not limited to:
PylonArrowPylonBowPylonBucketPylonToolPylonWeapon
Implementation Example:
public class MyCustomWeapon extends PylonItem implements RuneApplicable {
@Override
public boolean isApplicableToTarget(
@NotNull PlayerDropItemEvent event,
@NotNull ItemStack rune
) {
// Only allow diamond swords to be applied with runes
return target.getType() == Material.DIAMOND_SWORD;
}
}
-
Method Summary
Modifier and TypeMethodDescriptionbooleanapplicableToTarget(@NotNull org.bukkit.event.player.PlayerDropItemEvent event, @NotNull org.bukkit.inventory.ItemStack rune) Called when a rune is dropped on a target item.
-
Method Details
-
applicableToTarget
boolean applicableToTarget(@NotNull @NotNull org.bukkit.event.player.PlayerDropItemEvent event, @NotNull @NotNull org.bukkit.inventory.ItemStack rune) Called when a rune is dropped on a target item.- Parameters:
event- The eventrune- The rune- Returns:
- true if the rune is applicable to the target item, false otherwise
-