Mechanics
Other WikisDonate
  • Home
  • Examples
  • Placeholders
  • ⚙️Mechanics
    • Action Bar
    • Boss Bar
    • Command
    • Custom Sound
    • Damage
    • Drop Item
    • Fake Item
    • Firework
    • Flinch
    • Ignite
    • Leap
    • Lightning
    • Message
    • Particle
    • Potion
    • Push
    • Sculk Bloom
    • Sculk Shriek
    • Sound
    • Title
    • Warden Disturbance
  • 🎯Targeters
    • ServerPlayers
    • Shapes
      • Box
      • Scatter
    • Source
    • Target
    • World
  • ❔Conditions
    • Biome
    • Custom Biome
    • Entity Type
    • Gliding
    • Has Permission
    • InCone
    • Light Level
    • Material Category
    • On Ground
    • Range
    • Riding
    • Sneaking
    • Sprinting
  • 🔌Integrations
    • 🌊GeyserMC
    • 🌎MechanicsEverywhere
    • 👽MythicMobs
    • 🔫WeaponMechanics
Powered by GitBook
On this page
  1. Conditions

Material Category

Last updated 1 year ago

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.

FLUID checks if the current location is inside of water/lava. In 1.13+, this also checks if you are inside a waterlogged block.

CAVE_AIR checks if the block is a block.

VOID_AIR checks if the block is a block.

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.

❔
cave air
void air