public interface Beacon extends TileState, Lockable, Nameable
Modifier and Type | Method and Description |
---|---|
double |
getEffectRange()
Gets the effect range of this beacon.
|
@NotNull Collection<LivingEntity> |
getEntitiesInRange()
Returns the list of players within the beacon's range of effect.
|
@Nullable PotionEffect |
getPrimaryEffect()
Returns the primary effect set on the beacon
|
@Nullable PotionEffect |
getSecondaryEffect()
Returns the secondary effect set on the beacon.
|
int |
getTier()
Returns the tier of the beacon pyramid (0-4).
|
void |
resetEffectRange()
Resets the custom range from this beacon and falls back to the range based on the the beacon tier.
|
void |
setEffectRange(double range)
Sets the effect range of the beacon
A negative range value means the beacon is using its default range based on tier.
|
void |
setPrimaryEffect(@Nullable PotionEffectType effect)
Set the primary effect on this beacon, or null to clear.
|
void |
setSecondaryEffect(@Nullable PotionEffectType effect)
Set the secondary effect on this beacon, or null to clear.
|
getPersistentDataContainer
getBlock, getBlockData, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isPlaced, setBlockData, setData, setRawData, setType, update, update, update
getMetadata, hasMetadata, removeMetadata, setMetadata
customName, customName, getCustomName, setCustomName
@NotNull @NotNull Collection<LivingEntity> getEntitiesInRange()
This will return an empty list if the block represented by this state is no longer a beacon.
IllegalStateException
- if this block state is not placedint getTier()
@Nullable @Nullable PotionEffect getPrimaryEffect()
void setPrimaryEffect(@Nullable @Nullable PotionEffectType effect)
effect
- new primary effect@Nullable @Nullable PotionEffect getSecondaryEffect()
void setSecondaryEffect(@Nullable @Nullable PotionEffectType effect)
effect
- desired secondary effectdouble getEffectRange()
setEffectRange(double)
or the range based on the beacon tier.void setEffectRange(double range)
range
- Radius of effect range.void resetEffectRange()
Copyright © 2021. All rights reserved.