Allow mobs to be hit

This commit is contained in:
2026-09-30 10:29:13 -03:00
parent 9e580f175e
commit 65f27d6099
8 changed files with 143 additions and 1 deletions
+6
View File
@@ -95,6 +95,12 @@ export class MultiPlayerGameMode {
container.set_item(index, item.amount > 0 ? item : undefined);
}
// left click on an entity, the server decides whether it's hurt
attack(entity: RemoteEntity) {
this.client.player.send_position_now();
this.client.connection.send({ type: "attack_entity", id: entity.id });
}
// right click on nothing
use_item() {
this.client.connection.send({ type: "use_item" });