module.exports=inject;

function inject(serv, player) 
{
  player._client.on("arm_animation", function(packet) {
    player._writeOthers("animation", {
      entityId: player.entity.id,
      animation: 0
    });
  });

  function setMetadata(metadata)
  {
    player.entity.metadata = metadata;
    player._writeOthers("entity_metadata", {
      entityId: player.entity.id,
      metadata: player.entity.metadata
    });
  }

  player._client.on("entity_action", function(packet) {
    if(packet.actionId == 3)
      setMetadata([{"key":0,"type":"byte","value": 0x08}]);
    if(packet.actionId == 4)
      setMetadata([{"key":0,"type":"byte","value": 0x00}]);
    if(packet.actionId == 0)
      setMetadata([{"key":0,"type":"byte","value": 0x02}]);
    if(packet.actionId == 1)
      setMetadata([{"key":0,"type":"byte","value": 0x00}]);
  });
}
@@ -532,38 +532,33 @@
 %7B%22key%22:0,%22type%22:
-%22byte%22
+0
 ,%22value%22: 0x08%7D%5D
@@ -616,38 +616,33 @@
 %7B%22key%22:0,%22type%22:
-%22byte%22
+0
 ,%22value%22: 0x00%7D%5D
@@ -700,38 +700,33 @@
 %7B%22key%22:0,%22type%22:
-%22byte%22
+0
 ,%22value%22: 0x02%7D%5D
@@ -796,14 +796,9 @@
 pe%22:
-%22byte%22
+0
 ,%22va

fix metadata (nmp 0.15)