- Add commands in 1.18
-
Add commands in 1.18
Command class public class BruhCommand { public static void register(CommandDispatcher<CommandSourceStack> dispatcher){ dispatcher.register(Commands.literal("bruh").executes((command) -> { return execute(command); })); } private static int execute(CommandContext<CommandSourceStack> command){ if(command.getSource().getEntity() instanceof Player){ Player player = (Player) command.getSource().getEntity(); player.sendMessage(new TextComponent("bruh"), Util.NIL_UUID); } return Command.SINGLE_SUCCESS; } } Register command in RegisterCommands event @Mod.EventBusSubscriber(modid = ModMain.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class ModEventListener { @SubscribeEvent public static void registerCommands(RegisterCommandsEvent event){ BruhCommand.register(event.getDispatcher()); } }
-
Cant normally render quads
I have this code to overlay block public static void drawOutline(PoseStack poseStack, VoxelShape shape, double x, double y, double z, BlockPos pos){ Matrix4f matrix4f = poseStack.last().pose(); Tesselator tesselator = Tesselator.getInstance(); BufferBuilder bufferIn = tesselator.getBuilder(); RenderSystem.setShader(GameRenderer::getPositionShader); RenderSystem.setShaderColor(0.0F, 0.0F, 0.25F, 1.0F); RenderSystem.disableTexture(); bufferIn.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION); shape.forAllEdges((x0, y0, z0, x1, y1, z1) -> { bufferIn.vertex(matrix4f, (float)(x0 + x), (float)(y0 + y), (float)(z0 + z)).color(1.0f, 0.0f, 0.0f, 1.0f).normal(0, 0, 0).endVertex(); bufferIn.vertex(matrix4f, (float)(x1 + x), (float)(y1 + y), (float)(z1 + z)).color(1.0f, 0.0f, 0.0f, 1.0f).normal(0, 0, 0).endVertex(); }); tesselator.end(); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.enableTexture(); } but i'm getting this result
-
Overlay and outline entity
Just entity (ItemEntity is here, but can be any) Entity with translucent overlay and white overline
-
Overlay and outline entity
Just block Block with overlay
- Overlay and outline entity
-
Overlay and outline entity
overlay like redness during attack
-
Overlay and outline entity
I want to outline the entity, but not like the glowing effect. I want to make this outline a static color, not a white to black gradient. Also I want to make 2d overlay for entity. Render a translucent white over the rendered entity. Any ideas how this can be implemented?
-
How to send russian text (Set encoding)
My file encoding is utf-8, but i keep getting hieroglyphs. I need to do it without TranslatableComponent.
-
Eye of ender summoned by entity leading to 0,0 instead of stronghold.
Here is what I was able to find blockpos - The block of the STRONGHOLD structure closest to the player who launched the ender eye
-
How to send russian text (Set encoding)
- How to send russian text (Set encoding)
I'm sending command response But I don't get Russian letters in the chat. I get hieroglyphs.- [1.18.1] Custom command prefix
I'm check ChatScreen, it has a "package" property commandSuggestions, it is automatically updated by other classes, but I couldn't figure out how- [1.18.1] Custom command prefix
Now I can get the current input, but I still don't understand how to display my suggestion- [1.18.1] Custom command prefix
How can i get current user message input (before sending) and display suggestion? - How to send russian text (Set encoding)
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.