Allow mobs to be hit
This commit is contained in:
@@ -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" });
|
||||
|
||||
Reference in New Issue
Block a user