Annotation Interface SoundTranslator


@Retention(RUNTIME) public @interface SoundTranslator
Marks if a class should be handled as a SoundInteractionTranslator.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The identifier(s) that the placed block must contain one of.
    The identifier(s) that the interacted entity must have.
    boolean
    Controls if the interaction should still be called even if the player is sneaking while holding something in their hand.
    The identifier(s) that the player's hand item must contain one of.
  • Element Details

    • blocks

      String[] blocks
      The identifier(s) that the placed block must contain one of. Leave empty to ignore. Only applies to interaction handlers that are an instance of BlockSoundInteractionTranslator.
      Returns:
      the value the interacted block must contain
      Default:
      {}
    • items

      String[] items
      The identifier(s) that the player's hand item must contain one of. Leave empty to ignore.
      Returns:
      the value the item in the player's hand must contain
      Default:
      {}
    • entities

      String[] entities
      The identifier(s) that the interacted entity must have. Leave empty to ignore. Only applies to interaction handlers that are an instance of EntitySoundInteractionTranslator.
      Returns:
      the value the item in the player's hand must contain
      Default:
      {}
    • ignoreSneakingWhileHolding

      boolean ignoreSneakingWhileHolding
      Controls if the interaction should still be called even if the player is sneaking while holding something in their hand.
      Returns:
      if the interaction should continue when player is holding something in their hand
      Default:
      false