Class ChatResponse
-
- All Implemented Interfaces:
public abstract class ChatResponseA chat response.
-
-
Constructor Summary
Constructors Constructor Description ChatResponse()
-
Method Summary
Modifier and Type Method Description final ServerLevelgetLevel()final UnitsetLevel(ServerLevel level)final ServerPlayergetSender()final UnitsetSender(ServerPlayer sender)IntegergetDelay()BooleangetCaseSensitive()BooleanisFullMessage()abstract List<String>getTriggers()A list of strings that trigger this response. final Booleancheck(String message)Check if this response matches the message based on the conditions. IntegergetDelay(ServerLevel level, ServerPlayer sender)If you need more custom logic for delay times than a constant, override this. abstract Unitrespond(ServerLevel level, ServerPlayer sender)Called when the chat response is triggered. final Unitexecute(ServerLevel level, ServerPlayer sender)Call the chat response (internal). final UnitafterTicks(Integer afterTicks, Function0<Unit> action)Do some work after a set number of ticks. final UnitplaySound(Vec3 pos, SoundEvent sound, Float volume, Float pitch)Play a sound at a given position in the current level. final UnitplaySound(ServerLevel level, Vec3 pos, SoundEvent sound, Float volume, Float pitch)Play a sound at a given position in a specific level. final UnitplayGlobalSound(SoundEvent sound, Float volume, Float pitch)Play a sound to all players in the current level. final UnitplayGlobalSound(ServerLevel level, SoundEvent sound, Float volume, Float pitch)Play a sound to all players in a specific level. -
-
Method Detail
-
getLevel
final ServerLevel getLevel()
-
getSender
final ServerPlayer getSender()
-
getCaseSensitive
Boolean getCaseSensitive()
-
isFullMessage
Boolean isFullMessage()
-
getTriggers
abstract List<String> getTriggers()
A list of strings that trigger this response.
-
check
final Boolean check(String message)
Check if this response matches the message based on the conditions.
-
getDelay
Integer getDelay(ServerLevel level, ServerPlayer sender)
If you need more custom logic for delay times than a constant, override this.
-
respond
abstract Unit respond(ServerLevel level, ServerPlayer sender)
Called when the chat response is triggered.
-
execute
final Unit execute(ServerLevel level, ServerPlayer sender)
Call the chat response (internal).
-
afterTicks
final Unit afterTicks(Integer afterTicks, Function0<Unit> action)
Do some work after a set number of ticks.
-
playSound
final Unit playSound(Vec3 pos, SoundEvent sound, Float volume, Float pitch)
Play a sound at a given position in the current level.
-
playSound
final Unit playSound(ServerLevel level, Vec3 pos, SoundEvent sound, Float volume, Float pitch)
Play a sound at a given position in a specific level.
-
playGlobalSound
final Unit playGlobalSound(SoundEvent sound, Float volume, Float pitch)
Play a sound to all players in the current level.
-
playGlobalSound
final Unit playGlobalSound(ServerLevel level, SoundEvent sound, Float volume, Float pitch)
Play a sound to all players in a specific level.
-
-
-
-