I used CustomMachine to create the block 'dumpling_plate' and registered a block called 'plate'. When I right-click the 'plate' block while holding a specified item, the block is set to 'dumpling_plate', and the item is added to the container. Throughout this process, there were no errors, everything proceeded as expected. However, after 'plate' becomes 'dumpling_plate', 'dumpling_plate' adopts the default texture of CustomMachine, not the specified texture. Even triggering a block update or using 'F3 + T' to reload resource packs doesn't change it unless I use the '/reload' command or exit and re-enter the save. Besides, during multiplayer games, I noticed that this issue only occurs for the player who turn 'plate' into 'dumpling_plant', while it appears normal to other players' perspectives.
StartupEvents.registry('block', event => {
event.create("dumpling:dumpling_plate", "custommachinery").machine("dumpling:dumpling_plate")
});
BlockEvents.rightClicked(event => {
if (event.hand != "MAIN_HAND") {
return;
};
if (event.block.getId() == 'dumpling:plate') {
if (event.player.mainHandItem.getId() == 'dumpling:boiled_dumpling') {
event.block.set('dumpling:dumpling_plate');
let machine = CustomMachine.of(event.block);
machine.addItemToSlot("slot1", event.player.mainHandItem, false);
event.player.mainHandItem.count -= 1;
event.cancel();
}
}
});