Material Category

The light level condition checks the block of the targeted location. It can detect different kinds of air, and fluids. This can be used by WeaponMechanics to play underwater muffled sounds.

Argument
Description
Default Value

category

Which category to use (see below for options)

*Required

AIR allows any non-fluid, non-cave-air, non-void-air block. This is the option that most users should be using.

Mechanics:
  - "Sound{sound=ENTITY_ENDERMAN_HURT, pitch=0.5, listenerConditions=[MaterialCategory{category=FLUID}]} @Target{}"
  - "Sound{sound=ENTITY_ENDERMAN_HURT, pitch=2.0, listenerConditions=[MaterialCategory{category=FLUID, inverted=true}]} @Target{}"

This example plays the enderman hurt sound at the targeted location. Players who are underwater will hear a very low-pitched sound, but players above water will hear a high-pitched sound.

Last updated