Title Scrolls

Title Scrolls

Mod

A mod allowing players to have craftable titles

Client and server AdventureDecorationEquipmentGame MechanicsLibraryManagementSocialUtility

96 downloads
9 followers
Follow Save
90% of ad revenue goes to creators. Go ad-free while supporting creators with Modrinth Plus. Subscribe today!

Title Scrolls

This mod is a near rewrite of TitleScrolls by repulica. Some code from the original was modified to suit the rewrite, so it remains under the original license. All textures are from the original.

Discription

Title Scrolls adds trinkets that display a title under player names. Common title scrolls can be crafted with two paper and two string and renamed in an anvil to set the title. All Titles are component-based, so adding one is as simple as customizing a give command.

Gameplay Images

A Player renaming a scroll to give it a custom title A Custom Title Scroll A Player with A Custom Title A Player With a Command Generated Title

Modders

As all titles are component-based, adding a title to a mod is as simple as adding a new component to the title scroll item.

public class Demo implements ModInitializer {
    @Override
    public void onInitialize() {
        ItemStack stack = new ItemStack(Items.BASE_TITLE_SCROLL);
        stack.set(ComponentTypes.TITLE_TEXT, TitleTextComponet.of(Text.literal("Early Bird")));
        stack.set(ComponentTypes.SCROLL_LORE, ScrollLoreComponent.of(List.of(Text.literal("The Early Bird catches the worm"))));
        stack.set(ComponentTypes.RIBBON_COLOR, RibbonColorComponent.of(0x00FF00));
        stack.set(ComponentTypes.RENDER_EFFECT, RenderEffectComponent.of(Identifier.of("modid", "demo")));
    }
}

Adding a new Effect is as simple as creating a class implementing titlescrolls.api.TitleEffect and registering it with the TitleEffects.INSTANCE#register(Identfier, TitleEffect).

public class Demo implements ModInitializer {
    TitleEffect DEMO = new TitleEffect() {
        @Override
        public void render(ItemStack stack, SlotReference slot, MatrixStack matrixStack, 
                           VertexConsumerProvider vertexConsumer, int light,
                           EntityModel<? extends LivingEntity> model, LivingEntity player,
                           float headYaw, float headPitch) {
            //Render your effect here
        }
    };
    @Override
    public void onInitialize() {
        TitleEffects.INSTANCE.register(new Identifier("modid", "demo"), DEMO);
    }
}

Project members

cputnam-a11y

Developer

repulica

Originator

Details

Licensed MPL-2.0
Published 2 months ago
Updated 2 months ago