Skip to content

Player functionality #5

@WalshyDev

Description

@WalshyDev

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");
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions