Class SculkSensorFrequencyRegistry

java.lang.Object
net.fabricmc.fabric.api.registry.SculkSensorFrequencyRegistry

public final class SculkSensorFrequencyRegistry extends Object
Provides a method for registering sculk sensor frequencies.
  • Method Details

    • register

      public static void register(GameEvent event, int frequency)
      Registers a sculk sensor frequency for the given game event.

      A frequency is defined as the redstone signal strength a sculk sensor will emit to a comparator when it detects a specific vibration.

      As redstone signal strengths are limited to a maximum of 15, a frequency must also be between 1 and 15. As such, many game events will share a single frequency.

      Note that the game event must also be in the GameEventTags.VIBRATIONS tag to be detected by sculk sensors in the first place. The same applies for interactions with the Warden in the GameEventTags.WARDEN_CAN_LISTEN tag.

      Parameters:
      event - The event to register the frequency for.
      frequency - The frequency to register.
      Throws:
      IllegalArgumentException - if the given frequency is not within the allowed range.