Commits
Doc authored and md_5 committed c0ecd48cfde
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 + | |
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( 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 + | |
34 + | PotionEffect addEffect( 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 + | } |