Could it be possible for a player to do more than one action in one tick? Like send a command and break a block. I know the player behind his computer can’t break a block and send a command, but in theory could it be possible?
Your given example isn’t that correct. The chat (and command sending from there) is async, so it doesn’t rely on ticks.
You can observe this behavior on some servers that lag much. Everyone writes in the chat “Laaaaaaaaaaaaag” as soon as the server lags. These chat messages get through fluently although there might be a tps of 1.
The real answer to your question I don’t know. (But I think yes, many actions in 1 tick)
Maybe a message, but a command should be sync with the server to interact with the server.
Okay, I agree.
15 chars…
Are we talking whether you can do that in sponge?
Simple,
public void onTick() { // Some tick handler
world.setBlock(BlockTypes.AIR, x, y, z); // Break block
// Side note - to simulate a player breaking a block, do:
world.digBlock(position, cause);
Sponge.getCommandManager().process(player, "somecommand"); // Run a command
}
If you’re talking about whether a client can send more than one action per tick, then yes.
Packets sent from the client are added to a queue to be processed in the following tick. Simply send two consecutive packets and they will both be added to the queue for the next tick.