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