UNPKG

pack-mc-2

Version:
47 lines (44 loc) 1.05 kB
var {ActivePlugin} = require( "../Plugin" ) var {MinecraftObject: McObj} = require( "../Util" ) class Entity { constructor( plugin, id, name ){ this.plugin = plugin this.name = name this.spawnable = true this.summonable = true this.objBeh = new McObj( "entity", id ) this.objRes = new McObj( "client_entity", id ) this.objRes.onGenerateJSON = ( json ) => { json[ "minecraft:client_entity" ].description = { identifier: this.objRes.id, } } this.objBeh.onGenerateJSON = ( json ) => { json[ "minecraft:entity" ].description = { identifier: this.objBeh.id, is_spawnable: this.spawnable, is_summonable: this.summonable } } } setId( id ){ this.objBeh.id = id this.objRes.id = id return this } getId( id ){ return this.objBeh.id } setName( name ){ this.name = name return this } generate(){ } } class EntityPlugin extends ActivePlugin { constructor( ctx ){ super( "Entity", ctx ) this.entities = [] } }