Custom Switches and Speakers
The normal registration methods are enough for most variants.
If you need custom Java-side behavior, you can provide your own block class.
- A custom switch must extend
DoorBellSwitchBlock - A custom speaker must extend
DoorBellSpeakerBlock
Custom switch
DoorBellApi.registerSwitchVariant(
MyMod.id("custom_switch"),
BlockSetType.OAK,
MyCustomSwitchBlock::new,
properties
);
Custom speaker
DoorBellApi.registerSpeakerVariant(
MyMod.id("custom_speaker"),
MyCustomSpeakerBlock::new,
properties
);
This is useful for things such as:
- Custom hitboxes
- Custom shapes
- Special block behavior
- Other Java-side block logic
Your custom block still uses the Advanced Door Bells system underneath.