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 public interface AnyNamed extends AnyProvider
A provider for anything with a (text) name. Anything implementing this (or convertible to this) can be used by the ExprName property expression.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @UnknownNullability String
     
    default void
    The behaviour for changing this thing's name, if possible.
    default boolean
    This is called before setName(String).
  • Method Details

    • name

      @UnknownNullability String name()
      Returns:
      This thing's name
    • supportsNameChange

      default boolean supportsNameChange()
      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
      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