Skip to content
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

Player functionality #5

Open
WalshyDev opened this issue Jul 4, 2023 · 0 comments
Open

Player functionality #5

WalshyDev opened this issue Jul 4, 2023 · 0 comments

Comments

@WalshyDev
Copy link
Member

It would be awesome to have the ability to make a player join, move them around, place/break blocks.

How we do this, I'm not too sure especially between versions.

Proposed APIs:

@E2ETest(description = "Test that `/sf versions` returns the right MC version")
public void testMcVersion() {
	// Make our player join the game
	final MockPlayer player = TestUtililies.playerJoin();

	// Move, give a composter and place it down
	player.moveTo(4, 5, 5);
	player.runCommand("/sf give " + player.getName() + " COMPOSTER");
	player.placeItemInHand(5, 5, 5); // place at 5x, 5y, 5z

	// Assert that the block at 5, 5, 5 is a composter
	Assert.blockIsItem(new Location(player.getWorld(), 5, 5, 5), "COMPOSTER");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant