Interface AnyAmount

All Superinterfaces:
AnyProvider
All Known Implementing Classes:
CursorSlot, DisplayEntitySlot, DroppedItemSlot, EquipmentSlot, InventorySlot, ItemFrameSlot, ItemType, SkriptQueue, Slot, SlotWithIndex, ThrowableProjectileSlot
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Deprecated(since="2.13", forRemoval=true) public interface AnyAmount extends AnyProvider
Deprecated, for removal: This API element is subject to removal in a future version.
Use Property.AMOUNT instead.
A provider for anything with a (number) amount/size. Anything implementing this (or convertible to this) can be used by the PropExprAmount property expression.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Number
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    default void
    setAmount(Number amount)
    Deprecated, for removal: This API element is subject to removal in a future version.
    The behaviour for changing this thing's name, if possible.
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    This is called before setAmount(Number).
  • Method Details

    • amount

      @NotNull @NotNull Number amount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      This thing's amount/size
    • supportsAmountChange

      default boolean supportsAmountChange()
      Deprecated, for removal: This API element is subject to removal in a future version.
      This is called before setAmount(Number). If the result is false, setting the name will never be attempted.
      Returns:
      Whether this supports being set
    • setAmount

      default void setAmount(Number amount) throws UnsupportedOperationException
      Deprecated, for removal: This API element is subject to removal in a future version.
      The behaviour for changing this thing's name, if possible. If not possible, then supportsAmountChange() should return false and this may throw an error.
      Parameters:
      amount - The name to change
      Throws:
      UnsupportedOperationException - If this is impossible
    • isEmpty

      default boolean isEmpty()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      Whether the amount of this is zero, i.e. empty