https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/tileentity/altar/AltarTileEntity.java
https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/main/registry/EvileDeferredRegistry.java#L125
https://github.com/GenElectrovise/MagiksMostEvile/blob/1.15.2/src/main/java/genelectrovise/magiksmostevile/common/main/registry/EvileDeferredRegistry.java#L59
These should help
Correct!
And don't forget to register your DeferredRegister using:
TILE_ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus());
Or something similar. I do this in the constructor of my EvileDeferredRegistry, which is called in the constructor of my main mod class.
No surprises here ... It isn't very intuitive (I think). Somewhere on this forum is me asking this exact question !
You have to use TileEntityBuilder.Builder#create:
public static final RegistryObject<TileEntityType<AmethystCrystalTileEntity>> TILE_ENTITY_AMETHYST_CRYSTAL = TILE_ENTITIES.register("tile_entity_amethyst_crystal", () -> TileEntityType.Builder.create(AmethystCrystalTileEntity::new, EvileDeferredRegistry.AMETHYST_CRYSTAL.get()).build(null));
You pass a new instance of your TileEntity (which must have a 0 argument constructor), and the Block you want to bind the TileEntity to. Then you have to call build(null) on the created Object.