Interface AnyNamed

All Superinterfaces:
AnyProvider
All Known Implementing Classes:
Config, CursorSlot, DisplayEntitySlot, DroppedItemSlot, DynamicFunctionReference, EntryNode, EquipmentSlot, InvalidNode, InventorySlot, ItemFrameSlot, ItemType, Node, Script, SectionNode, SimpleNode, Slot, SlotWithIndex, ThrowableProjectileSlot, VoidNode
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 AnyNamed extends AnyProvider
Deprecated, for removal: This API element is subject to removal in a future version.
Use Property.NAME instead.
A provider for anything with a (text) name. Anything implementing this (or convertible to this) can be used by the PropExprName property expression.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @UnknownNullability String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    default void
    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 setName(String).
  • Method Details

    • name

      @UnknownNullability String name()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      This thing's name
    • supportsNameChange

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

      default void setName(String name) 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 supportsNameChange() should return false and this may throw an error.
      Parameters:
      name - The name to change
      Throws:
      UnsupportedOperationException - If this is impossible