Bed stays occupied after a lightning turns the villager sleeping in it into a witch
The bug
When lightning hits a villager that is sleeping in a bed, the villager will turn into a witch, and the bed will stay occupied forever.
To reproduce
- Place a bed
- Spawn a villager next to it
- Set time to night
- Run /summon minecraft:lightning_bolt ~ ~ ~ while on the bed
- The villager turns into a witch and leaves the bed
- Right-click onto the bed
→
The message "This bed is occupied" appears
Code analysis
Code analysis and potential fix can be found in this comment.
2019-12-07, 01:43 PM
2024-09-05, 02:30 PM
2024-09-05, 02:30 PM
22
12
1.14.4 - 1.21.1
1.14.4, 1.15 Pre-release 6, 1.15.1, 1.15.2, 20w12a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20b, 1.16 Pre-release 5, 1.16, 1.16.1, 20w28a, 1.16.2, 1.16.3, 1.16.4, 20w48a, 21w03a, 1.17, 1.17.1, 1.18.2, 22w19a, 1.19, 1.19.2, 22w45a, 22w46a, 1.19.3 Pre-release 1, 1.19.3 Release Candidate 3, 1.19.3, 23w03a, 23w17a, 1.20 Pre-release 1, 1.20.1, 1.20.2, 23w41a, 1.20.3 Pre-Release 4, 1.20.6, 1.21, 1.21.1