How do i make something happen when the player wakes up

Started by Chasebear777 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i make something happen when the player wakes up

I know about the Player wakes up global procedure but i need it to work when the player actually wakes up, because even if you just click on the bed, even when its day the procedure will still activate, are there any solutions to fix this?

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use a global…
Sat, 03/05/2022 - 03:42

You can use a global variable so you can control when you want this event to be cancelled, this will also prevent the player from setting their spawnpoint on the bed, though you can still remove the variable check and add a new spawnpoint on x, y, z (as the event will provide you those coordinates from the block that was right clicked) + add the message rendered on the toolbar (And maybe adding an NBT tag / variable to stop it from activating when the spawnpoint was already set?) 

 

[player right clicks on block global procedure]

if globalvariable_a == true :
    if [provided block] == [bed] :

        if [is day] && [not][is thundering] :

            [cancel event]