The selected global trigger is not cancellable

Started by theDisruptor on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The selected global trigger is not cancellable

I saw many times that you can cancel "Player goes to bed" global trigger event, but now you can't do it that way, am I just dumb, or this feature was removed? :/ (if yes pls bring it back)

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah it seems like it's not…
Wed, 11/06/2024 - 16:53

Yeah it seems like it's not cancellable rn. You could probably just use the player rightclicks on block instead tho.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if (event instanceof…
Thu, 11/07/2024 - 06:17
if (event instanceof CanPlayerSleepEvent event_) {
event_.setProblem(Player.BedSleepingProblem.NOT_POSSIBLE_NOW); }

Use that in code snippet in Player goes to bed procedure.

These are available problems:

        NOT_POSSIBLE_HERE,
        NOT_POSSIBLE_NOW(Component.translatable("block.minecraft.bed.no_sleep")),
        TOO_FAR_AWAY(Component.translatable("block.minecraft.bed.too_far_away")),
        OBSTRUCTED(Component.translatable("block.minecraft.bed.obstructed")),
        OTHER_PROBLEM,
        NOT_SAFE(Component.translatable("block.minecraft.bed.not_safe"));