Skip to content

Commit

Permalink
if entityData is undefined, bot would crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
LetsChill committed Jul 3, 2023
1 parent 7af50a8 commit d94621a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/plugins/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ function inject (bot) {
const entity = fetchEntity(packet.entityId)
const entityData = bot.registry.entities[packet.type]

entity.type = entityData.type || 'object'
if (entityData.type) {
entity.type = entityData.type
} else {
entity.type = 'object'
}
setEntityData(entity, packet.type, entityData)

if (bot.supportFeature('fixedPointPosition')) {
Expand Down

0 comments on commit d94621a

Please sign in to comment.