Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PotionMeta.java
1 package org.bukkit.inventory.meta;
2 
3 import org.bukkit.Material;
6 
7 import java.util.List;
8 
9 /**
10  * Represents a potion ({@link Material#POTION}) that can have custom effects.
11  */
12 public interface PotionMeta extends ItemMeta {
13 
14  /**
15  * Checks for the presence of custom potion effects.
16  *
17  * @return true if custom potion effects are applied
18  */
19  boolean hasCustomEffects();
20 
21  /**
22  * Gets an immutable list containing all custom potion effects applied to
23  * this potion.
24  * <p>
25  * Plugins should check that hasCustomEffects() returns true before
26  * calling this method.
27  *
28  * @return the immutable list of custom potion effects
29  */
30  List<PotionEffect> getCustomEffects();
31 
32  /**
33  * Adds a custom potion effect to this potion.
34  *
35  * @param effect the potion effect to add
36  * @param overwrite true if any existing effect of the same type should be
37  * overwritten
38  * @return true if the potion meta changed as a result of this call
39  */
40  boolean addCustomEffect(PotionEffect effect, boolean overwrite);
41 
42  /**
43  * Removes a custom potion effect from this potion.
44  *
45  * @param type the potion effect type to remove
46  * @return true if the potion meta changed as a result of this call
47  */
49 
50  /**
51  * Checks for a specific custom potion effect type on this potion.
52  *
53  * @param type the potion effect type to check for
54  * @return true if the potion has this effect
55  */
56  boolean hasCustomEffect(PotionEffectType type);
57 
58  /**
59  * Moves a potion effect to the top of the potion effect list.
60  * <p>
61  * This causes the client to display the potion effect in the potion's
62  * name.
63  *
64  * @param type the potion effect type to move
65  * @return true if the potion meta changed as a result of this call
66  */
67  boolean setMainEffect(PotionEffectType type);
68 
69  /**
70  * Removes all custom potion effects from this potion.
71  *
72  * @return true if the potion meta changed as a result of this call
73  */
74  boolean clearCustomEffects();
75 
76  PotionMeta clone();
77 }
boolean addCustomEffect(PotionEffect effect, boolean overwrite)
boolean removeCustomEffect(PotionEffectType type)
boolean setMainEffect(PotionEffectType type)
List< PotionEffect > getCustomEffects()
boolean hasCustomEffect(PotionEffectType type)