mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-19 14:31:17 +00:00
26 lines
No EOL
788 B
JavaScript
26 lines
No EOL
788 B
JavaScript
module.exports.player=function(player)
|
|
{
|
|
player._client.on("arm_animation", () =>
|
|
player.behavior('punch', {}, () => {
|
|
player._writeOthersNearby("animation", {
|
|
entityId: player.id,
|
|
animation: 0
|
|
});
|
|
})
|
|
);
|
|
|
|
|
|
player._client.on("entity_action", ({actionId} = {}) => {
|
|
if(actionId == 3) {
|
|
player.setAndUpdateMetadata([{"key":0,"type":0,"value": 0x08}]);
|
|
} else if(actionId == 4) {
|
|
player.setAndUpdateMetadata([{"key":0,"type":0,"value": 0x00}]);
|
|
} else if(actionId == 0) {
|
|
player.setAndUpdateMetadata([{"key":0,"type":0,"value": 0x02}]);
|
|
player.crouching = true;
|
|
} else if(actionId == 1) {
|
|
player.setAndUpdateMetadata([{"key":0,"type":0,"value": 0x00}]);
|
|
player.crouching = false;
|
|
}
|
|
});
|
|
}; |