Swift Adventure Lab Wiki › Guides › Use Dummy Players to Test Interactions
Use Dummy Players to Test Interactions
Spawn a Dummy Player
Dummy players are fake players you can control to simulate player actions. Spawn one using:
`
/dummy TestPlayer spawn
`
The dummy will appear in the world at your current location.
Command Your Dummy to Act
Once spawned, you can make your dummy perform actions:
/dummy TestPlayer mine <x> <y> <z>— mines a block at those coordinates/dummy TestPlayer attack <entity>— attacks a specific entity- Dummies automatically jump and move during tests
Verify the Results
After commanding your dummy, use /assert or /await to check that the expected outcome occurred. For example, after mining:
`
/dummy TestPlayer mine 0 64 0
/await delay 20
/assert block 0 64 0 air
`
Clean Up
Remove the dummy when your test is complete:
`
/dummy TestPlayer leave
`