Files
MinecraftChat/app/server/bot/events/health.js
T
shugen002 fdc031e660 add new feature:
show position , health ,weather and food
2016-02-01 17:38:35 +08:00

13 lines
326 B
JavaScript

export default (socket) => {
let onHealth = () => {
var health = socket.mcbot.health || 0;
var food = socket.mcbot.food||0;
var foodSaturation = socket.mcbot.foodSaturation||0;
socket.emit('bot:health', {health:health,food:food,foodSaturation:foodSaturation});
};
socket.mcbot.on('health', onHealth);
};