Package org.bukkit.inventory.view
Interface BeaconView
- All Superinterfaces:
InventoryView
An instance of
InventoryView
which provides extra methods related to
beacon view data.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.inventory.InventoryView
InventoryView.Property
-
Field Summary
Fields inherited from interface org.bukkit.inventory.InventoryView
OUTSIDE
-
Method Summary
Modifier and TypeMethodDescriptionGets the primary effect of the beacon.Gets the secondary effect of the beacon.int
getTier()
Gets the tier of the beaconGet the upper inventory involved in this transaction.void
setPrimaryEffect
(PotionEffectType effect) Sets the primary effect of the beacon, or null to clearvoid
setSecondaryEffect
(PotionEffectType effect) Sets the secondary effect on this beacon, or null to clear.Methods inherited from interface org.bukkit.inventory.InventoryView
close, convertSlot, countSlots, getBottomInventory, getCursor, getInventory, getItem, getOriginalTitle, getPlayer, getSlotType, getTitle, getType, setCursor, setItem, setProperty, setTitle
-
Method Details
-
getTopInventory
Description copied from interface:InventoryView
Get the upper inventory involved in this transaction.- Specified by:
getTopInventory
in interfaceInventoryView
- Returns:
- the inventory
-
getTier
int getTier()Gets the tier of the beaconBeacon tier is deduced by the height of the pyramid the beacon is standing on. The level of the beacon is 0 unless the beacon is activated.
- Returns:
- The tier of the beacon
-
getPrimaryEffect
Gets the primary effect of the beacon.If the beacon level is high enough where the primary effect can be upgraded to level two, e.g. Speed 2. Instead of
getSecondaryEffect()
being null itgetSecondaryEffect()
returns the samePotionEffectType
as this method.- Returns:
- The primary effect enabled on the beacon
-
getSecondaryEffect
Gets the secondary effect of the beacon.If the beacon level is high enough where the primary effect can be upgraded to level two, e.g. Speed 2. The secondary effect will return the same effect as
getPrimaryEffect()
.- Returns:
- The secondary effect enabled on the beacon
-
setPrimaryEffect
Sets the primary effect of the beacon, or null to clearThe
PotionEffectType
provided must be one that is already within the beacon as a valid option.- Parameters:
effect
- desired primary effect
-
setSecondaryEffect
Sets the secondary effect on this beacon, or null to clear. Note that tier must be >= 4 and a primary effect must be set in order for this effect to be active.The
PotionEffectType
provided must be one that is already within the beacon as a valid option.- Parameters:
effect
- the desired secondary effect
-