Search the Community
Showing results for tags '1.20.2'.
-
Hello, I want to make it so that a certain part of my mob model is rendered as a portal to the end. Using the second layer I was able to render a second model with the portal effect, but I don't need the whole model. How to fix this? (This is a test mob, I want to render its head as a portal). Current code: Constructor of Renderer public MegovidRenderer(EntityRendererProvider.Context pContext) { super(pContext, new MegovidModel<>(pContext.bakeLayer(ModModelLayers.MEGOVID_LAYER)), 0.5f); this.addLayer(new MegovidHeadRenderer(this)); } Register renderer @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { EntityRenderers.register(ModEntities.MEGOVID.get(), MegovidRenderer::new); } HeadRenderer public class MegovidHeadRenderer<T extends LivingEntity> extends RenderLayer<T, MegovidModel<T>> { private static final RenderType GATEWAY = RenderType.endGateway(); public MegovidHeadRenderer(RenderLayerParent<T, MegovidModel<T>> pRenderer) { super(pRenderer); } @Override public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, T t, float v, float v1, float v2, float v3, float v4, float v5) { poseStack.pushPose(); poseStack.translate(0,-2,0); this.getParentModel().renderToBuffer( poseStack, multiBufferSource.getBuffer(this.renderType()), 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); poseStack.popPose(); } private RenderType renderType() { return GATEWAY; } } Result:
-
Hello, I'm creating a mod that should have a classic config file that I create with: ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC); but I want also to have into server config folder more files .yml that I handle from the plugin. How can I create that yaml files?
-
I made a basic homing arrow, which I am going to refine further, but as of now I have the problem of the Arrow not rendering properly. It works fine on the server side, but on the client it always appears as if the arrow was flying normally, until it synchs and teleports around. [https://gemoo.com/tools/upload-video/share/661346070437036032?codeId=MpmzxaW0pBpE1&card=661346066800603136&origin=videolinkgenerator] the white particles are created by the entity every tick on the server side and represent its actual flying path. My best guess is that this behaviour is caused, because minecraft appears to try to predict the projectiles path on the client side instead of constantly synching (perhaps something to do with it implementing the TracableEntity interface??). I am thinking I need help with either 1. Getting the client to use my custom Tick function in its path prediction, or 2. (the less elegant solution) getting the game to synch up the direction, position and movement etc. every tick. Note that my custom arrow class extends AbstractArrow. everything important it does: private static final EntityDataAccessor<Integer> TARGET_ENTITY = SynchedEntityData.defineId(ReachArrow.class, EntityDataSerializers.INT); @Override public void addAdditionalSaveData(CompoundTag pCompound) { super.addAdditionalSaveData(pCompound); pCompound.putInt("TargetEntity", this.getTargetEntity()); } @Override public void readAdditionalSaveData(CompoundTag pCompound) { super.readAdditionalSaveData(pCompound); this.setTargetEntity(pCompound.getInt("TargetEntity")); } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(TARGET_ENTITY, -1); } @Override public void shootFromRotation(Entity pShooter, float pX, float pY, float pZ, float pVelocity, float pInaccuracy) { LivingEntity target = ReachArrow.findNearestTarget(this.level(),(LivingEntity) pShooter,50d); if(pShooter instanceof LivingEntity && target !=null){ //pShooter.sendSystemMessage(Component.literal("setting id "+target.getId()+" as target")); setTargetEntity(target.getId()); //pShooter.sendSystemMessage(Component.literal("target set")); } super.shootFromRotation(pShooter, pX, pY, pZ, pVelocity, pInaccuracy); } public static LivingEntity findNearestTarget(Level world, LivingEntity shooter, double range) { AABB searchBox = shooter.getBoundingBox().inflate(range); List<LivingEntity> potentialTargets = world.getEntitiesOfClass(LivingEntity.class, searchBox, EntitySelector.NO_SPECTATORS); LivingEntity nearestTarget = null; double closestDistance = Double.MAX_VALUE; for (LivingEntity potentialTarget : potentialTargets) { if (potentialTarget != shooter && potentialTarget.isAlive()) { double distance = shooter.distanceToSqr(potentialTarget); if (distance < closestDistance) { closestDistance = distance; nearestTarget = potentialTarget; } } } return nearestTarget; } I tried fixing the problem by storing the Target using SynchedEntityData, which not only didn't fix the problem, but also added unwanted, blue particles to the arrow (like on tipped arrow) Thank you in advance for any help or hints, I am quite new at this so you could probably help me a lot. :)
-
Greetings! If you clicked on this I can only assume you have at the very least a slight interest in using Minecraft as a vehicle for creating stories, roleplaying, and worldbuilding, which is amazing to hear, thank you for your interest and I will do my best to explain this as much as I can here but I would like to start by advising you to join our discord, even if you have the slightest interest you can leave whenever you want and I can explain this whole thing a whole lot better. Our goal is to foster a creative and unified community and thrive on a minecraft server that was made for creating everything from nations to individual cultures. This recruitment post is for a newly formed guild, "The Order of Artemis", led by House Artemis. but fear not if you have ambitions to create your own nation or guild, simply join our discord and we will help you get set up. Our guild is all about making the experience as positive as possible for everyone! If you've never heard of something like this before that's perfect, come on down and we will get you started on your journey! If your a veteran of this type of thing we also welcome you and promise you will find the experience with us enjoyable. I would love to explain more about our lore and what we have going on here but it wouldn't fit here, so if this at all interests you join our discord and contact us! We would love to have you and are happy to answer all questions mand promise to ensure you will enjoy your time with us. https://discord.com/invite/mssaVdTB
-
Hello, I'm working on my first Minecraft 1.20.2 mod. However, I've created a custom block model and everything works perfectly except the rotation of the block. The code is implemented but it still doesnt work. Need help. This is the code of the object class. import net.minecraft.core.BlockPos; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.HorizontalDirectionalBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.Mirror; public class DirtyRock extends HorizontalDirectionalBlock { public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 2, 11); public DirtyRock(Properties pProperties) { super(pProperties); } @Override public VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { return SHAPE; } @Override public BlockState getStateForPlacement(BlockPlaceContext pContext) { return this.defaultBlockState().setValue(FACING, pContext.getHorizontalDirection().getOpposite()); } @Override public BlockState rotate(BlockState pState, Rotation pRot) { return pState.setValue(FACING, pRot.rotate(pState.getValue(FACING))); } @Override public BlockState mirror(BlockState pState, Mirror pMirror) { return pState.rotate(pMirror.getRotation(pState.getValue(FACING))); } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> pBuilder) { pBuilder.add(FACING); } } In the ModBlocks class the block is registred like this public static final RegistryObject<Block> DIRTY_ROCK=registerBlock("dirty_rock", ()-> new DirtyRock(BlockBehaviour.Properties.copy(Blocks.STONE_BUTTON))); private static <T extends Block>RegistryObject<T> registerBlock(String name, Supplier<T> block){ RegistryObject<T> toReturn=BLOCKS.register(name,block); registerBlockItem(name,toReturn); return toReturn; } In the Data, ModBlockStateProvider the blockstate is implemened simpleBlock(ModBlocks.DIRTY_ROCK.get(), new ModelFile.UncheckedModelFile(modLoc("block/dirty_rock"))); And in resources/assets/modname/models/block dirty_rock.json is implemented { "credit": "Made with Blockbench", "textures": { "0": "wildandhunt:block/dirty_bricks_block", "particle": "wildandhunt:block/dirty_bricks_block" }, "elements": [ { "from": [5, 0, 4], "to": [9, 1, 8], "rotation": {"angle": 22.5, "axis": "y", "origin": [10, 0, 7]}, "faces": { "north": {"uv": [5, 4, 10, 5], "texture": "#0"}, "east": {"uv": [5, 5, 10, 6], "texture": "#0"}, "south": {"uv": [5, 6, 10, 7], "texture": "#0"}, "west": {"uv": [5, 7, 10, 8], "texture": "#0"}, "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, "down": {"uv": [5, 5, 0, 10], "texture": "#0"} } }, { "from": [9, 0, 4.05], "to": [11, 2, 6.05], "rotation": {"angle": 22.5, "axis": "y", "origin": [8, 0, 9]}, "faces": { "north": {"uv": [5, 4, 10, 5], "texture": "#0"}, "east": {"uv": [5, 5, 10, 6], "texture": "#0"}, "south": {"uv": [5, 6, 10, 7], "texture": "#0"}, "west": {"uv": [5, 7, 10, 8], "texture": "#0"}, "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, "down": {"uv": [5, 5, 0, 10], "texture": "#0"} } }, { "from": [5, 0, 7], "to": [6, 1, 8], "rotation": {"angle": 22.5, "axis": "y", "origin": [10, 0, 10]}, "faces": { "north": {"uv": [5, 4, 10, 5], "texture": "#0"}, "east": {"uv": [5, 5, 10, 6], "texture": "#0"}, "south": {"uv": [5, 6, 10, 7], "texture": "#0"}, "west": {"uv": [5, 7, 10, 8], "texture": "#0"}, "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, "down": {"uv": [5, 5, 0, 10], "texture": "#0"} } }, { "from": [10, 0, 8], "to": [12, 1, 9], "rotation": {"angle": 22.5, "axis": "y", "origin": [15, 0, 11]}, "faces": { "north": {"uv": [5, 4, 10, 5], "texture": "#0"}, "east": {"uv": [5, 5, 10, 6], "texture": "#0"}, "south": {"uv": [5, 6, 10, 7], "texture": "#0"}, "west": {"uv": [5, 7, 10, 8], "texture": "#0"}, "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, "down": {"uv": [5, 5, 0, 10], "texture": "#0"} } }, { "from": [9.4, 0, 5], "to": [12.4, 1, 8.5], "rotation": {"angle": 22.5, "axis": "y", "origin": [12, 0, 7]}, "faces": { "north": {"uv": [8, 0, 11, 1], "texture": "#0"}, "east": {"uv": [8, 2, 10, 3], "texture": "#0"}, "south": {"uv": [8, 1, 11, 2], "texture": "#0"}, "west": {"uv": [8, 3, 10, 4], "texture": "#0"}, "up": {"uv": [8, 2, 5, 0], "texture": "#0"}, "down": {"uv": [8, 2, 5, 4], "texture": "#0"} } }, { "from": [6, 1, 6], "to": [10, 1.75, 10], "rotation": {"angle": 22.5, "axis": "y", "origin": [9, 0, 7]}, "faces": { "north": {"uv": [8, 0, 11, 1], "texture": "#0"}, "east": {"uv": [8, 2, 10, 3], "texture": "#0"}, "south": {"uv": [8, 1, 11, 2], "texture": "#0"}, "west": {"uv": [8, 3, 10, 4], "texture": "#0"}, "up": {"uv": [8, 2, 5, 0], "texture": "#0"}, "down": {"uv": [8, 2, 5, 4], "texture": "#0"} } } ], "display": { "thirdperson_righthand": { "translation": [0, 7.75, 0] }, "thirdperson_lefthand": { "translation": [0, 7.75, 0] }, "firstperson_righthand": { "translation": [0, 8.25, 0] }, "firstperson_lefthand": { "translation": [0, 8.25, 0] }, "ground": { "translation": [0, 4, 0] }, "gui": { "rotation": [32, 32, 9], "translation": [-1.25, 6.25, 0], "scale": [1.31, 1.31, 1.31] }, "fixed": { "translation": [0, 6.75, 0] } }, "groups": [ { "name": "dirty_stone", "origin": [8, 0, 7], "color": 0, "children": [0, 1, 2, 3, 4, 5] } ] }
-
i am a skyblock player with average mods, however when i open my game, none of the mods show, it is just the forge mod loader. I have like 6 mods but they just don't show in the mod menue of the game, everything else runs fine. in using version 1.20.2 of forge and most of my mods are up to date. This issue didnt happen with oklder versions of forge. yes, everything is in my mod folder, any help is appreciated
-
Hey folks. I am working on a custom "Mecha" entity (extended from LivingEntity) that the player builds up from blocks that should get modular stats depending on the used blocks. e.g. depending on what will be used for the legs, the entity will have a different jump strength. However, something unexpected is happening when trying to override a few of LivingEntity's functions and using my new own "Mecha" specific fields: instead of their actual instance-specific value, the default value is used (0f for a float, null for an object...) This is especially strange as when executing with the same entity from a point in the code specific to the mecha entity, the correct value is used. Here are some code snippets to better illustrate what I mean: /* The main Mecha class, cut down for brevity */ public class Mecha extends LivingEntity { protected float jumpMultiplier; //somewhere later during the code when spawning the entity, jumpMultiplier is set to something like 1.5f //changing the access to public didn't help @Override //Overridden from LivingEntity, this function is only used in the jumpFromGround() function, used in the aiStep() function, used in the LivingEntity tick() function protected float getJumpPower() { //something is wrong with this function //for some reason I can't correctly access the fields and methods from the instanciated entity when I am in one of those overridden protected functions. this is very annoying LogUtils.getLogger().info(String.valueOf(this.jumpMultiplier))) //will print 0f return this.jumpMultiplier * super.getJumpPower(); } //The code above does not operate properly. Written as is, the entity will not jump, and adding debug logs shows that when executing the code, the value of this.jumpMultiplier is 0f //in contrast, it will be the correct value when done here: @Override public void tick() { super.tick(); //inherited LivingEntity logic //Custom logic LogUtils.getLogger().info(String.valueOf(this.jumpMultiplier))) //will print 1.5f } } My actual code is slightly different, as the jumpMuliplier is stored in another object (so I am calling "this.legModule.getJumpPower()" instead of the float), but even using a simple float exactly like in the code above didn't help. When running my usual code, the object I try to use is found to be null instead, leading to a crash from a nullPointerException. Here is the stacktrace of said crash: The full code can be viewed here. I have found a workaround in the case of jump strength, but have already found the same problem for another parameter I want to do, and I do not understand why the code is behaving as such, and I would very much like to be able to override those methods as intended - they seemed to work just fine like that for vanilla mobs... Any clues as to what may be happening here?
-
I am migrating a mod from 1.16.5 to 1.20.2 The version for 1.16.5 can be found here https://github.com/beothorn/automataCraft For the block called automata_start, it uses TileEntities and has blockstates, model/block and textures on json files. This is currently working fine on 1.16.5 https://github.com/beothorn/automataCraft/tree/master/src/main/resources/assets/automata For 1.20.2 I migrated the logic from TileEntities to BlockEntity. The mod is working fine. All blocks and Items are working with the correct textures except for the textures for each state of the automata_start block. No changes where made to the json files. This is the branch I am working on (there were some refactorings, but all is basically the same): https://github.com/beothorn/automataCraft/tree/1_20/src/main/resources/assets/automata The only difference I can think that may be related is that i had to implement createBlockStateDefinition on the BaseEntityBlock: https://github.com/beothorn/automataCraft/blob/1_20/src/main/java/br/com/isageek/automata/automata/AutomataStartBlock.java#L43 This is driving me crazy. I know the jsons are being loaded as I put a breakpoint at `net.minecraft.client.resources.model.ModelBakery#loadModel` and I can see BlockModelDefinition.fromJsonElement being called with automata_start. I also printed the state from the arguments of the tick function call and they look correct (https://github.com/beothorn/automataCraft/blob/1_20/src/main/java/br/com/isageek/automata/automata/Ticker.java#L32 ): blockState Block{automata:automata_start}[state=loadreplaceables] In game, all I see is the no textures. I think it is weird it is not the "missing texture" texture so I think it may be related to the material, but I had no success tweaking it (https://github.com/beothorn/automataCraft/blob/1_20/src/main/java/br/com/isageek/automata/automata/AutomataStartBlock.java#L37). public static final Property<AutomataStartState> state = EnumProperty.create("state", AutomataStartState.class); private final AtomicReference<RegistryObject<BlockEntityType<?>>> blockEntityType; private final Map<String, RegistryObject<Block>> registeredBlocks; public AutomataStartBlock( final AtomicReference<RegistryObject<BlockEntityType<?>>> blockEntityType, final Map<String, RegistryObject<Block>> registeredBlocks ) { super(BlockBehaviour.Properties.of().mapColor(MapColor.STONE).strength(1.5F, 6.0F)); this.blockEntityType = blockEntityType; this.registeredBlocks = registeredBlocks; this.registerDefaultState(this.getStateDefinition().any().setValue(state, AutomataStartState.LOAD_REPLACEABLES)); } @Override protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateBuilder) { stateBuilder.add(state); } So my cry for help is, anyone has any ideas? Is there a way to easily debug this, for example somewhere where I can list the textures for a given state, or make sure this is loaded? Thanks in advance for the hints
-
Hello everyone , I am trying to develop an AI controlled player with the help of dl4j using reinforcement learning. Unfortunatly when i try to add it to my gradle as shown in this link My Build won't work with this error: A problem occurred starting process 'command 'C:\Program Files\Java\jdk-17\bin\java.exe'' > Could not start 'C:\Program Files\Java\jdk-17\bin\java.exe' > Cannot run program "C:\Program Files\Java\jdk-17\bin\java.exe" (in directory "E:\minecraft_mod\build\reobfJar"): CreateProcess error=206,The filename or extension is too long > CreateProcess error=206, The filename or extension is too long I litteraly just spent 4 hours searching for solutions but none of them would work. The command size limitation made by windows is creating this error , there is a workaround in intelliJ , name "Shorten command lines" but it is only for application lauching. I found this solution for gradle but it also doesn't work. Most of the solution that i found were used for spring application using gradle so i am afraid it need more configuration for forge or it just won't work.
-
Hello everyone. I just started creating mod with forge and i am new to it. I saw some other post about my question but none resolved my problem. I tried this code but also with all the other method (move , moveto , lerpMotion) but none would work: public static int movingfunction(CommandContext<CommandSourceStack> context){ CommandSourceStack source = context.getSource(); if (!(source.getEntity() instanceof ServerPlayer)) { return 0; } ServerPlayer player = (ServerPlayer ) source.getEntity(); double moveSpeed = 0.5; for (int i =0; i<10000;i++) { LOGGER.info("running for the {} time", i); double x = player.getViewVector(1.0f).x * moveSpeed; double y = player.getViewVector(1.0f).y * moveSpeed; double z = 0; Vec3 movementVec = new Vec3(x, y, z); LOGGER.info("x ={} y ={} z ={}", x, y, z); player.moveRelative(0.0F, movementVec); ; } player.jumpFromGround(); return 1; // Code de retour de la commande } when i tried the code with move function my x and y were calculated this way : double x = player.getX() + player.getViewVector(1.0f).x * moveSpeed; double y = player.getY() + player.getViewVector(1.0f).y * moveSpeed; and when i would log them i could see they were increasing , but my player was still standing firmly on his spot. I feel like the position was updated on the server but not on the client side maybe ? thanks for your help.
-
I'm somewhat of a beginner at forge and I'm trying to add custom recipe types to my mod. I've been trying to adapt the solution from https://www.youtube.com/watch?v=IOFbegpYY0k and update it to 1.20.2 with the help of the forge docs without success. Does anyone know anything about creating such behaviour? Any help would be appreciated. My recipe is a simple recipe similar to the legacy smithing recipe, heres a JSON example (the "//" will be replaced with some items): { "type": "magic_overhaul:rune_inscribing", "base": { "item": "//base item" }, "template": { "item": "//template item" }, "output": { "count": 1, "item": "//output item" } } What I'm interested most is how to implement the RecipeSerializer and RecipeType classes within my Recipe class. Here's my current RecipeSerializer: Here's the RecipeType: Please comment if you need any more code fragments.
-
Hello, I want to create an item that when used, generates a structure. (structure don't generates naturally in world) Now I am having trouble generating a structure (jigsaw). The code below works, BUT the structure does not appear in the world until I re-enter it. This is a significant flaw that I would like to get rid of. My current code: public class MineshaftSpawnerItem extends Item { public MineshaftSpawnerItem(Properties pProperties) { super(pProperties); } @Override public @NotNull InteractionResult useOn(UseOnContext pContext) { Level pLevel = pContext.getLevel(); Player pPlayer = pContext.getPlayer(); BlockPos pBlockPos = pContext.getClickedPos(); ItemStack item = pContext.getItemInHand(); if (!pLevel.isClientSide()) { assert pPlayer != null; item.setCount(0); String command = MessageFormat.format("place structure weirdoitems:mineshaft {0} {1} {2}", pBlockPos.getX(), pBlockPos.getY(), pBlockPos.getZ()); System.out.println(command); try { Objects.requireNonNull(pLevel.getServer()).getCommands().getDispatcher().execute(command, pLevel.getServer().createCommandSourceStack()); } catch (CommandSyntaxException e) { throw new RuntimeException(e); } } return InteractionResult.PASS; } } I know about the PlaceCommand.placeStructure() method, but I can't figure out how to use it, and I can't find any documentation or examples of how to use it on the internet. Edit: I searched and tried normal options to solve this problem for a very long time, but nothing. I ended up doing it like this. And it works (in my case). @Override public @NotNull InteractionResult useOn(UseOnContext pContext) { Level pLevel = pContext.getLevel(); BlockPos pBlockPos = pContext.getClickedPos(); ItemStack item = pContext.getItemInHand(); if (!pLevel.isClientSide()) { item.setCount(0); JigsawBlockEntity jigsawBlockEntity = new JigsawBlockEntity(pBlockPos, Blocks.JIGSAW.defaultBlockState()); jigsawBlockEntity.setPool(Pools.createKey("weirdoitems:mineshaft/tunnels")); jigsawBlockEntity.setName(new ResourceLocation("weirdoitems:tunnel")); jigsawBlockEntity.setTarget(new ResourceLocation("weirdoitems:tunnel")); jigsawBlockEntity.setFinalState("minecraft:oak_planks"); jigsawBlockEntity.generate((ServerLevel) pLevel, 7, false); } return InteractionResult.CONSUME; }
-
I succeeded in rendering quads. However, they go dark when players are above them. Like these picture : https://drive.google.com/file/d/1zdbiE-pmGk3VuLy5ZSPtPDo-4UpHcKsa/view?usp=sharing https://drive.google.com/file/d/1AgJv2ncXjqRGh_oTURNCtVdMfDWws8s2/view?usp=sharing Is there something wrong with my codes? public class RenderTester implements BlockEntityRenderer<BlockEntityTester> { private static final ResourceLocation GRAVEL_TEXTURE = new ResourceLocation("textures/block/gravel.png"); public RenderTester (BlockEntityRendererProvider.Context context) {} @Override public void render(@NotNull BlockEntityTester pBlockEntity, float pPartialTick, @NotNull PoseStack pPoseStack, @NotNull MultiBufferSource pBuffer, int pPackedLight, int pPackedOverlay) { VertexConsumer builder = pBuffer.getBuffer(RenderType.entityCutoutNoCull(GRAVEL_TEXTURE)); BufferUtil.drawQuad(builder, pPoseStack, 0.0F, 1.0F, 0.0F, 1.0F, 1.0F, 1.0F, 0.0F, 0.0F, 1.0F, 1.0F, pPackedLight, pPackedOverlay, 0xFFFFFFFF); } } public class BufferUtil { public static void drawVertex(VertexConsumer builder, PoseStack poseStack, float x, float y, float z, float u, float v, int packedLight, int pPackedOverlay, int color) { builder.vertex(poseStack.last().pose(), x, y, z) .color(color) .uv(u, v) .overlayCoords(pPackedOverlay) .uv2(packedLight) .normal(0, 1, 0) .endVertex(); } public static void drawQuad(VertexConsumer builder, PoseStack poseStack, float x0, float y0, float z0, float x1, float y1, float z1, float u0, float v0, float u1, float v1, int packedLight, int pPackedOverlay, int color) { drawVertex(builder, poseStack, x0, y0, z0, u0, v0, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x0, y1, z1, u0, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y1, z1, u1, v1, packedLight, pPackedOverlay, color); drawVertex(builder, poseStack, x1, y0, z0, u1, v0, packedLight, pPackedOverlay, color); } }
-
How can I prevent blocks with no light value and/or not a part of the height map from being rendered to the camera/player? Especially when they are capable of seeing through solid blocks while underground, such as in spectator mode. Realizing this was just a version of anti-xray stuff, I found this mod: https://github.com/DrexHD/AntiXray/tree/1.20.4 which seems to prevent x-raying by handling chunk rendering, specifically the ClientboundLevelChunkWithLightPacket. Would this be the correct method to handle my problem? If so, is there a part of this mod's code that I should start with trying to implement to prevent blocks without light value being rendered?
-
So im trying to create an item that will send particles after RMC in the way that a player is looking. But I have a problem that it isn't seen on server. I created a packet. sendParticles won't work for me because it just spawns particles without vector speed. And addParticle only seen on client side(?). So is there a way to send particles with vector speed like addParticle so it will be seen on server? [1.20.2]
-
Improper Models and Textures for Pointed Dripstone Block
Wicked3Dee posted a topic in Modder Support
I'm creating a custom block using the 1.20.2 version of the Forge MDK, and this block is basically supposed to be identical to the Pointed Dripstone block in terms of model and behavior, just with a different texture and name. I would use a texture pack for this, but this is just one feature I'm adding in addition to several new mobs and generated structures for my mod, and additionally I don't want to replace the Pointed Dripstone block, I just want to create a second block that looks and acts like it, with a different name and texture. I've created the textures for every blockstate of the Pointed Dripstone block (the thickness and direction), I have a json for all the blockstate variants and individual jsons for each blockstate, and I've registered the block under the "ModBlocks" class as a PointedDripstoneBlock. However, in the game, the new block texture is constantly the "tip" blockstate texture, the background of the texture is black instead of transparent, the shape of the block is not accurate to the Pointed Dripstone block, and the blocks can't be placed on top of each other for some reason. I've tried several different things, and looked up a million variants of this question, but there just isn't anything I can find out there, likely because who the hell mods a pointed dripstone block?? I've included one of the jsons for one of the blockstates just as an example of how they're formatted, the json for the blockstate variants, and the ModBlocks class where this block is registered. I've also included a screenshot of what the block currently looks like in-game, compared to how the Pointed Dripstone block looks. The block is called "Titan Tooth", for reference. Please let me know what I'm getting wrong here, as I'm just going in circles at this point. My code: https://paste.ee/p/JrNWK How it looks in-game: -
error code 1 https://paste.ee/p/ToCkg apologies if i did this wrong
-
Does anybody know how to get old enchant glint from 1.17.1 on newer versions? not the texture pack but accualy to make it move on armors and items like in old versions. Is there any mod/shader to do it?
-
Hi everyone I've renamed a Biome Id in my mod, and as such, when I load a pre-existing world, I get this error when teleporting to said biome [Server thread/ERROR] [minecraft/ChunkSerializer]: Recoverable errors when loading section [-9, 0, 159]: (Unknown registry key in ResourceKey[minecraft:root / minecraft:worldgen/biome]: mineworld:volcanic_peak -> using default) -> volcanic peaks identified as plains where volcanic_peak is the old Id and volcanic_peaks is the new one. As such, the pre-generated biome is now identified as plains, causing some unintended behaviors in that biome (like rain and mobs spawning, wich my custom biome overrides). Is there a way to automatically convert the biome Id for old worlds? For example when loading the world or the chunk?
-
I'm gettin this crash once i join my modded server, im thinking the problem might be Biome Makeover but i need a second opinion Here's the log: https://mclo.gs/ajZgfJg
-
Ho installato Forge 1.20.2, ho cliccato col tasto sinistro due volte su installer.jar, non si apre e crea solo un file .log Il file contiene: JVM info: Oracle Corporation - 1.8.0_401 - 25.401-b10 java.net.preferIPv4Stack=true Current Time: 27/02/2024 18:18:10 Host: files.minecraftforge.net [51.79.83.165] Host: maven.minecraftforge.net [51.79.83.165] Host: libraries.minecraft.net [13.107.213.45, 13.107.246.45] Host: launchermeta.mojang.com [13.107.246.45, 13.107.213.45] Host: piston-meta.mojang.com [13.107.246.45, 13.107.213.45] java.net.UnknownHostException: authserver.mojang.com at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source) at java.net.InetAddress.getAddressesFromNameService(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at net.minecraftforge.installer.DownloadUtils.getIps(DownloadUtils.java:290) at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:120) Exception in thread "main" java.lang.NullPointerException at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:120)
-
Hello forgers, Can someone help me with with player detection functionality. I want the client to check if there is a player within 10 chunks of my character (same chunk included). So i need a way to constantly check if there is a player nearby. Maybe using the onClientTick event but i don't know what to use to achieve that. I've made mods back in forge 1.8 and a lot of things have changed since. Some methods got removed and some got changed. Any help is appreciated. Thank you!
-
🌟Welcome to Realm of Royalty! We are a fast-growing server with a variety of ways to play Minecraft, such as survival, skyblock, and prison [coming soon]. We welcome all players and hope to create a thriving community! 🌍Features Across the Server: Crates Level System Cosmetics Frequent Updates! ⛅Skyblock Features: Monthly Payouts Balanced Economy 🌳Survival Features: 50k x 50k World Claims Auction House Pokeballs Join Us! Discord: https://discord.gg/5CFNqyS4gD IP: play.realmofroyalty.net
-
Hello there I have been trying to rotate player upside down but can`t for some reason I tried many events and codes but still not able and the latest code I used is this package net.skatric.tutorialmod.event; import com.mojang.math.Axis; import net.minecraft.client.model.PlayerModel; import net.minecraft.client.player.AbstractClientPlayer; import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.skatric.tutorialmod.TutorialMod; import org.lwjgl.opengl.GL11; @Mod.EventBusSubscriber(modid = TutorialMod.MOD_ID,bus = Mod.EventBusSubscriber.Bus.FORGE) public class bodyrotation { static boolean checking = false; @SubscribeEvent public static void event(RenderPlayerEvent.Pre event) { if (checking == false) { checking = true; PlayerModel<AbstractClientPlayer> model = event.getRenderer().getModel(); event.getPoseStack().mulPose(Axis.XN.rotationDegrees(0f)); event.getPoseStack().mulPose(Axis.YN.rotationDegrees(0f)); event.getPoseStack().mulPose(Axis.ZN.rotationDegrees(180f)); } } }