feat(informer): add block info based on other players

Now should work for position of players other than the callee.

Alternative implementation could use `entity` function.
This allows to also work for named entities as a bonus.
master
jay 3 years ago
parent a0b4641f37
commit 2b7163bef3
  1. 7
      lib/plugins/informer.js

@ -263,8 +263,15 @@ function command(message_parts, player) {
block(player)
break
default:
const aPlayer = bot.players[message_parts[1]]
if (message_parts[1] in RelativePosEnum) {
block(undefined, message_parts[1])
} else if (aPlayer) {
if (aPlayer.entity) {
block(aPlayer.entity)
} else {
quiet || bot.chat(`info: player ${aPlayer.username} too far!`)
}
} else {
// or entity(message_parts[1]).position
console.log(bot.players[message_parts[1]])

Loading…
Cancel
Save