Fabric API

Fabric API

108M Downloads

A Error while trying to create a block entity

DanielGolan-mc opened this issue ยท 2 comments

commented

The Error:

error: BlockEntityFactory is not public in BlockEntityType; cannot be accessed from outside package
            TYPE = Registry.register(Registry.BLOCK_ENTITY_TYPE, "boson:fuel_chest", BlockEntityType.Builder.create(FuelChest.Entity::new, BosonElements.Blocks.FUEL_CHEST).build(null));
                                                                                                                    ^

TYPE is a variable, FuelChest.Entity is the BlockEntity, And the block FUEL_CHEST variable is stored in BosonElements.Blocks.

commented

You can use FabricBlockEntityTypeBuilder from fabric-object-builder-api-v1 instead of BlockEntityType.Builder to fix this.

commented

Marking this as closed, please ask on the #mod-dev channels on our official Discord server if you have further questions.