How do i make something happen when the player wakes up

Started by Chasebear777 on

Topic category: Help with modding (Java Edition)

Last seen on 23:28, 12. May 2024
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?

Last seen on 11:59, 11. Aug 2022
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]