Skip to content

Improve shared test reset: reset weather, time, effects, health, food… #3651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions test/externalTests/plugins/testCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ function inject (bot) {
await teleport(new Vec3(0, bot.test.groundY, 0))
await bot.waitForChunksToLoad()
await resetBlocksToSuperflat()
// Reset weather and time
bot.chat('/weather clear')
bot.chat('/time set day')
// Reset health and food
bot.chat('/effect clear @a')
bot.chat('/effect clear @p')
bot.chat('/attribute @p minecraft:generic.max_health base set 20')
bot.chat('/effect give @p minecraft:saturation 1 20 true')
bot.chat('/gamerule doDaylightCycle true')
bot.chat('/gamerule doWeatherCycle true')
bot.chat('/difficulty peaceful')
// Ensure OP status for the bot
bot.chat(`/op ${bot.username}`)
await sleep(1000)
await clearInventory()
}
Expand Down
Loading