Topic category: Minecraft mod ideas exchange
This has been bugging me non stop for a long time, there is no easy way to just define the slots and make recipe elements work in custom crafting table without making a procedure for it, also the real problem I have with this is that I cant add default recipes to custom crafting table without manually creating each and every one, and creating just one is already a pain in the ass. There should be an easy way to add default recipes and blacklist certain ones without manually making each and every one unless its a custom recipe to begin with.
At the moment I have found no practical way to do this, I'm quite sure that there isn't one to begin with inside McCreator, so I can only ask since basically all the tutorials on YouTube for custom crafting tables are the same and none have all default recipes, I'm honestly shocked that this wasn't one of the first things implemented with custom GUI...
I want to hear your thoughts on the matter and whether it's just me that feels the need to have this feature....
Also if anyone has a code snippet that can be put into McCreator that adds all the default recipes then please share tutorial.
Im sorry if this is late, but i found a way to open the vanilla crafting menu with a custom item in another forum, if that helps you at all.
if (entity instanceof ServerPlayer _entity) {
_entity.openMenu(new MenuProvider() {
@Override
public Component getDisplayName() {
return Component.translatable("container.crafting");
}
@Override
public AbstractContainerMenu createMenu(int syncId, Inventory playerInv, Player player) {
return new CraftingMenu(syncId, playerInv, new ContainerLevelAccess() {
public <T> Optional<T> evaluate(BiFunction<Level, BlockPos, T> func) {
return Optional.of(func.apply(player.level(), player.blockPosition()));
}
}){
public boolean stillValid(Player player) {
return true;
}
};
}
});
}
You will need to add dependencies with blocks that will never run, like this:
The "if {false}" condition has the blocks that add the dependencies required to run the custom code snippet, since MCreator doesnt read custom code/locked elements.
Also i do agree, this should be a feature already, but sadly its not...