EffectData
Holds the data an MCPotionEffect should have to pass a parent predicate check.
This predicate can check various properties of the effect, such as its duration or amplifier value. It is also able to verify whether the effect has been applied by the ambient or by a potion and whether the effect has visible particles or not.
By default, no restrictions are placed on the effect's data.
导入相关包
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
Extending AnyDefaultingVanillaWrappingPredicate
EffectData extends AnyDefaultingVanillaWrappingPredicate. That means all methods available in AnyDefaultingVanillaWrappingPredicate are also available in EffectData
方法
withAmbient
Indicates that the effect must be environmental.
An example of such effect is the one applied by a beacon.
If the predicate had already been set to check the opposite condition, the setting will be overwritten.
Return Type: EffectData
withBoundedAmplifier
Sets both the minimum and maximum value the amplifier should be to min
and max
respectively.
If the amplifier had already some bounds specified, then they will be overwritten with the new values.
Both minimum and maximum values are inclusive, meaning that a value that is equal to either min
or
max
will pass the check.
Return Type: EffectData
withBoundedDuration
Sets both the minimum and maximum value the duration should be to min
and max
respectively.
If the duration had already some bounds specified, then they will be overwritten with the new values.
Both minimum and maximum values are inclusive, meaning that a value that is equal to either min
or
max
will pass the check.
Return Type: EffectData
withExactAmplifier
Sets the amplifier to exactly match the given value
.
If the amplifier had already some bounds specified, then they will be overwritten with the new value.
Return Type: EffectData
withExactDuration
Sets the duration to exactly match the given value
.
If the duration had already some bounds specified, then they will be overwritten with the new value.
Return Type: EffectData
withInvisibility
Indicates that the effect's particles must be invisible.
If the predicate had already been set to check the opposite condition, the setting will be overwritten.
Return Type: EffectData
withMaximumAmplifier
Sets the maximum value the amplifier should be to max
.
If the amplifier had already some bounds specified, then the maximum value of the bound will be overwritten with the value specified in max
. On the other hand, if the amplifier didn't have any bounds set, the maximum is set, leaving the lower end unbounded.
The maximum value is inclusive, meaning that a value that is equal to max
will pass the check.
Return Type: EffectData
withMaximumDuration
Sets the maximum value the duration should be to max
.
If the duration had already some bounds specified, then the maximum value of the bound will be overwritten with the value specified in max
. On the other hand, if the duration didn't have any bounds set, the maximum is set, leaving the lower end unbounded.
The maximum value is inclusive, meaning that a value that is equal to max
will pass the check.
Return Type: EffectData
withMinimumAmplifier
Sets the minimum value the amplifier should be to min
.
If the amplifier had already some bounds specified, then the minimum value of the bound will be overwritten with the value specified in min
. On the other hand, if the amplifier didn't have any bounds set, the minimum is set, leaving the upper end unbounded.
The minimum value is inclusive, meaning that a value that is equal to min
will pass the check.
Return Type: EffectData
withMinimumDuration
Sets the minimum value the duration should be to min
.
If the duration had already some bounds specified, then the minimum value of the bound will be overwritten with the value specified in min
. On the other hand, if the duration didn't have any bounds set, the minimum is set, leaving the upper end unbounded.
The minimum value is inclusive, meaning that a value that is equal to min
will pass the check.
Return Type: EffectData
withVisibility
Indicates that the effect's particles must be visible.
If the predicate had already been set to check the opposite condition, the setting will be overwritten.
Return Type: EffectData
withoutAmbient
Indicates that the effect must not be environmental.
If the predicate had already been set to check the opposite condition, the setting will be overwritten.
Return Type: EffectData