Skip to content

Conversation

@roro1506HD
Copy link
Contributor

@roro1506HD roro1506HD commented Oct 18, 2025

Alright, been looking at that stuff for some hours now and here's what I came up with.

Observations

With the arrival of environment attributes, beds mechanism has received quite some changes.
The two settings natural and bed_works have been split in three settings: can_sleep, can_spawn_at and explodes which means that beds can now:

  • Be slept in without changing the spawn point
  • Set the spawn point without being able to sleep in it
  • Prevent from being slept in without an explosion happening

Note that whenever the explodes field is set, the bed can no longer be slept in and can no longer set the spawn point.

Proposed changes

  • We can keep both results/reasons NOT_POSSIBLE_NOW and NOT_POSSIBLE_HERE as a way for developers to know which one exactly triggered the events, and it's not something hard to keep track of using the new attributes.
  • Add a new result/reason EXPLOSION that is triggered everytime a bed is about to explode. This was previously associated with NOT_POSSIBLE_HERE but due to the settings changes, NOT_POSSIBLE_HERE can now be triggered without a bed explosion.

Updated javadocs according to these changes, if you find anything strange or any spelling issues let me know!

As for World#isBedWorks, I left a TODO with a question for its deprecation. Is it a method that we're good in deprecating due to underlying changes and a possible environment attribute API coming in at some point?


As discussed in paper-contrib:

  • World#isBedWorks has been deprecated since it no longer represents what the implementation does
  • A new API for beds to use in beds events has been created to better match latest vanilla changes

@roro1506HD roro1506HD requested a review from a team as a code owner October 18, 2025 17:27
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Oct 18, 2025
@roro1506HD roro1506HD marked this pull request as draft October 18, 2025 18:01
@roro1506HD roro1506HD marked this pull request as ready for review October 19, 2025 17:40
/**
* Entering the bed is prevented and the bed explodes.
*/
EXPLOSION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it still worth to add new values to deprecated things anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think so but since It was added before the API rework I left it there. I'm conflicted between "it's done so we may let it be" and "there's a rework so no need to modify deprecated things". I'm fine with both on this one honestly, whatever fits the needs best for the team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

2 participants