-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Entities doc for 1.21 is incorrect #175
Comments
@Rabbit0w0 I had the exact same issue and just saw that it is caused because you need to register the newly created BLOCK_ENTITY_TYPES to the mod event bus. Like this, by using the starting ModDevGradle example repository. // The constructor for the mod class is the first code that is run when your mod is loaded.
// FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically.
public ExtraSync(IEventBus modEventBus, ModContainer modContainer)
{
// Register the commonSetup method for modloading
modEventBus.addListener(this::commonSetup);
// Register the Deferred Register to the mod event bus so blocks get registered
BLOCKS.register(modEventBus);
// Register the Deferred Register to the mod event bus so items get registered
ITEMS.register(modEventBus);
// Register the Deferred Register to the mod event bus so tabs get registered
CREATIVE_MODE_TABS.register(modEventBus);
// Register the Deferred Register to the mod event bus so block entities get registered
BLOCK_ENTITY_TYPES.register(modEventBus);
...
} Is it possible to add this mention to the documentation? |
We do link to the relevant pages for registration using |
As title.
Code in doc:
but the
register
method actually acceptsBlock
instead ofDeferredBlock
Also, by following the doc to build a example mod, it actually doesn't work with the exception:
java.lang.NullPointerException: Trying to access unbound value: ResourceKey[minecraft:block_entity_type / customfurniture:furniture_entity]
, which is thrown when constructing a new block entity and unboxingSupplier<BlockEntityType<MyBlockEntity>>
mc ver: 1.12.1
neo: 21.1.65
The text was updated successfully, but these errors were encountered: