Commits

Doc authored and md_5 committed c0ecd48cfde
SPIGOT-7942: Add Consumable Component
No tags

src/main/java/org/bukkit/inventory/meta/components/consumable/effects/ConsumableApplyEffects.java

Added
1 +package org.bukkit.inventory.meta.components.consumable.effects;
2 +
3 +import java.util.List;
4 +import org.bukkit.potion.PotionEffect;
5 +import org.jetbrains.annotations.NotNull;
6 +
7 +/**
8 + * Represent the effects applied when an item is consumed.
9 + */
10 +public interface ConsumableApplyEffects extends ConsumableEffect {
11 +
12 + /**
13 + * Gets the effects which may be applied by this item when consumed.
14 + *
15 + * @return consumable effects
16 + */
17 + @NotNull
18 + List<PotionEffect> getEffects();
19 +
20 + /**
21 + * Sets the effects which may be applied by this item when consumed.
22 + *
23 + * @param effects new effects
24 + */
25 + void setEffects(@NotNull List<PotionEffect> effects);
26 +
27 + /**
28 + * Adds an effect which may be applied by this item when consumed.
29 + *
30 + * @param effect the effect
31 + * @return the added effect
32 + */
33 + @NotNull
34 + PotionEffect addEffect(@NotNull PotionEffect effect);
35 +
36 + /**
37 + * Gets the probability of this effect being applied.
38 + *
39 + * @return probability
40 + */
41 + float getProbability();
42 +
43 + /**
44 + * Sets the probability of this effect being applied.
45 + *
46 + * @param probability between 0 and 1 inclusive.
47 + */
48 + void setProbability(float probability);
49 +}

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut