[SOLVED] Display text on block like signs

Started by MCCercus on

Topic category: Help with MCreator software

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED] Display text on block like signs
Mon, 07/14/2025 - 12:28 (edited)

Hello,

I searched all the posts and videos that mention creating a block with the same behaviour as signs, but none of them describe the implementation of sign behaviour consistently or precisely. I tried to implement it myself, but I don't know how to display text on a block when the player types text in a GUI. What is the method for performing this operation ?

 

Here are some screns

The gui procedure : 

 

The gui display : 

 

The tag "Block entity" :

 

Thank for advance

Edited by MCCercus on Mon, 07/14/2025 - 12:28
Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Update : I've managed to…
Sun, 07/13/2025 - 08:42

Update : 

I've managed to store the value of my text field in the block in an nbtTag, but now how do I display it on the block ?

 

I checked this option : 



The final procedure who launched when the player click on button "Validate" :

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello, After a few tests, I…
Mon, 07/14/2025 - 12:27

Hello,

After a few tests, I've found a way to display text on a block. Here's how to do it (for anyone else wondering):

 

This procedure requires manual modifications of the files generated by MCreator (and a good knowledge of JAVA and minecraft modding):

3) Create a new class implementing BlockEntityRenderer<? extends BlockEntity> in a package named “renders”, for example. The render() method is used to configure the text display.

 

public class SignCityBlockRenderer implements BlockEntityRenderer<SignCityBlockBlockEntity> { // SignCityBlockBlockEntity is the class name of my custom block entity

	private final Font font;
	private final BlockEntityRendererProvider.Context context;

	public SignCityBlockRenderer(BlockEntityRendererProvider.Context context) {
		this.context = context;
		this.font = context.getFont();
	}

	@Override
	public void render(SignCityBlockBlockEntity blockEntity, float partialTicks, PoseStack poseStack, MultiBufferSource buffer, int combinedLight, int combinedOverlay) {
		String text = blockEntity.getCustomText();

		 if (text == null || text.isEmpty()) return;
		
		// Here you can put your custom code to display the text (color, size...)
		
	}

 

4) In the mod's main class (with the @Mod annotation), insert these lines: 
 

// Start of user code block mod init
if (FMLEnvironment.dist == Dist.CLIENT) {
	modEventBus.addListener(this::registerEntityRenderers);
}
// End of user code block mod init

 

5) Still in the main class,  insert these lines: 
 

// Start of user code block mod methods
private void registerEntityRenderers(EntityRenderersEvent.RegisterRenderers event) {
    System.out.println("[DEBUG] registerEntityRenderers called");
    event.registerBlockEntityRenderer(
        MoreroadsModBlockEntities.SIGN_CITY_BLOCK.get(), // This is your bloc entity
        SignCityBlockRenderer::new // This is your custom class who implements 
        						   //BlockEntityRenderer
    );
}
// End of user code block mod methods

6) Check that all imports into modified classes are correct

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey, is it cool if u can…
Sat, 07/26/2025 - 04:16

Hey, is it cool if u can share a template of the sign setup (like a workspace download)? I need it for my mod, and I can't figure it out for the life of me. Thanks