Class BaseEvent

  • All Implemented Interfaces:

    
    public abstract class BaseEvent
    
                        

    An event.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseEvent(Integer weight)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • BaseEvent

        BaseEvent(Integer weight)
    • Method Detail

      • execute

         abstract Unit execute(ServerLevel level, ServerPlayer player, Vec3 pos)

        Called when the event is executed.

      • run

         final Unit run(ServerLevel level, ServerPlayer player, Vec3 pos)

        Executes the event. This will call execute(), then start the queue.

      • afterTicks

         final Unit afterTicks(Integer afterTicks, Function0<Unit> action)

        Do some work (the action parameter) on the server after a specified number of ticks.

      • queue

         final Unit queue(Integer afterTicks, Function0<Unit> action)

        Queue a task to run after the provided number of server ticks. Keep in mind that the ticks will be counted AFTER the rest of the event's execution.

      • playSound

         final Unit playSound(Vec3 pos, SoundEvent sound, Float volume, Float pitch)

        Play a sound at a location in the current level.

      • playSound

         final Unit playSound(ServerLevel level, Vec3 pos, SoundEvent sound, Float volume, Float pitch)

        Play a sound at a location in a specific level.

      • playGlobalSound

         final Unit playGlobalSound(ServerLevel level, SoundEvent sound, Float volume, Float pitch)

        Play a sound to all players in a specific level.