perromercenary00
Members-
Posts
849 -
Joined
-
Last visited
-
Days Won
5
Everything posted by perromercenary00
-
How to get All Woods and their Planks?
perromercenary00 replied to JoeBox9's topic in Modder Support
i do something similar and is complicated public static Map<String, BlockState> blocklist = new HashMap<String, BlockState>();// list whit all blocks Block actualBlock = null; String type = ""; String nnn = ""; int count = 0; //load hashmap whit all blocks and fix their names for (Entry<ResourceKey<Block>, Block> ResourceKey : ForgeRegistries.BLOCKS.getEntries()) { actualBlock = ResourceKey.getValue(); nnn = fix_blkfullname(actualBlock.getName().getString()); blocklist.put(nnn, actualBlock.defaultBlockState()); if (nnn.contains("slab")) { slablist.put(nnn, ""); } count++; } // ########## ########## ########## ########## ########## ########## // public static String fix_blkfullname(String blkfullname) { if (blkfullname.contains(".")) { String[] split1 = blkfullname.split("\\."); // "\\." if (split1.length > 1) { blkfullname = split1[split1.length - 1].replaceAll("_", " "); } } return blkfullname.toLowerCase(); } is up to you to use the if (nnn.contains("slab")) { slablist.put(nnn, ""); } to find all tha planks and logs in the list and sort them as it suits you -
i wanna test what i have done alongside whith other mods like mrcraifish furniture twilith forest biomas you go etc ect all have i tested crash eclipse i drop the mod jars on workspace/mod-1.19.2-43.1.3/run/mods i have eclipse 2022-06 whit java JDK17 has someone know what its this happening i think that works well on old 1.8
-
good days guys i cannot manage how to solve this issue i made a manhole block whit a little animation for open and close i control the animation state whit the property age_3 so if its 0 the block is fully closed and if its 3 then is fully open thinking about it i end making two version of the block one whit the manhole on an the other without manhole and a third block only whit the manhole cover trapdoor_manhole_hole trapdoor_manhole_block manhole_cover_panel i wan it to behave way than if is age=0 fully closed it must to drop a trapdoor_manhole_block the version whit the manhole on but if is (age > 0 )than one it must drop trapdoor_manhole_hole and leave behind the cover manhole_cover_panel next to it this is the code i get from the oak slab im trying to change to suit mi needs but no avail it is just wrong and dont drops anything { "type": "minecraft:block", "pools": [ { "bonus_rolls": 0.0, "entries": [ { "type": "minecraft:item", "functions": [ { "add": false, "conditions": [ { "block": "basemmod:manhole_gravel_block", "condition": "minecraft:block_state_property", "properties": { "age": "0" } } ], "count": 1.0, "function": "minecraft:set_count" }, { "function": "minecraft:explosion_decay" } ], "name": "basemmod:manhole_gravel_hole" } ], "rolls": 1.0 } ] } is this the right approach or how i made a loot table suited for mi block ?
-
that it is file:///home/usuario/.minecraft/versions/1.19.2/1.19.2/data/minecraft/tags/blocks/climbable.json { "values": [ "basemmod:manhole_ladder_trapdoor", "basemmod:oak_ladder_trapdoor", "basemmod:oak_ladder", "basemmod:steel_ladder" ] } its only need to put the blocks on this list to behave as a ladder jummmm ineed to dosomthing like a water slab probably the fluid provider property is another json list not for from this
-
this is an especial trapdoor and the base from the manhole im working on the block opens and close and has the apropiate hitboxes but i need the block internal to behave as a common ladder i try extending LadderBlock also in block looks like is nothing especial also don't works public class LadderBlock extends Block implements SimpleWaterloggedBlock public class ladder_trapdoor extends LadderBlock i really dont get how to apply the ladder behaveour to mi block
-
[1.19.2] Basic question Traslucent block like glass ??
perromercenary00 replied to perromercenary00's topic in Modder Support
usuario@red:~/.minecraft/versions/1.19.2/1.19.2/assets/minecraft/models$ grep -i "cclusion" */*.json | grep -i "glass" block/template_glass_pane_noside_alt.json: "ambientocclusion": false, block/template_glass_pane_noside.json: "ambientocclusion": false, block/template_glass_pane_post.json: "ambientocclusion": false, block/template_glass_pane_side_alt.json: "ambientocclusion": false, block/template_glass_pane_side.json: "ambientocclusion": false, i also try the ambientocclusion thing but seems to affect nothing -
[1.19.2] Basic question Traslucent block like glass ??
perromercenary00 replied to perromercenary00's topic in Modder Support
next problem arise the block is translucent buts deleting the faces from the adjacent blocks soo you can look through the world i been doing some testing whit render type "render_type": "cutout", and "render_type": "translucent", do the same "render_type": "cutoutmipped", left the block opaque no transparency on the glass "render_type": "cutoutMipped", breaks the block textures to purple/black this has a fix ? to make the block translucent and drawing the adjacent block faces also i was thinking about making the block size to 0.99 as hack -
[1.19.2] Basic question Traslucent block like glass ??
perromercenary00 replied to perromercenary00's topic in Modder Support
this is defenitively bether this way { "parent": "basemmod:block/parent/parent_display", "textures": { "particle": "#side" }, "render_type": "cutout", "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 8, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, "north": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" } } } ] } -
[1.19.2] Basic question Traslucent block like glass ??
perromercenary00 replied to perromercenary00's topic in Modder Support
he ItemBlockRenderTypes works well but im curious whats the flag/option to put on the json ? -
i wass looking at the thing NbtUtils.read/writeBlockState() BlockEntity.loadStatic/saveWithFullMeta() reallly really dont get how to use that to save and s pawns extructures then hyperfocus thingly thing jumping on, end hardcoding the full thing and end adding it to mi block finder class theres a shitty thing whit enums not acepting string values in exchange for the equivalent objects WallSide.valueOf(value.toUpperCase()) //dont works WallSide.valueOf(value.toLowerCase()) //also dont works #### i would prefer a method to just take the blockstate metada as a int and set it back as an int after all it must be no more than a six figures binary number ################################################################################## do you have a link to more detailed tutrail on how to use the nbt thing to use extructures as nbts ?
-
Good days im currently trying to add some custome extructures to mi mod using a mix of mi custome blocks plus the vainilla ones in the old times a minecraft block could have up to 16 variants no more and there was methods to get the block metadata as an int value and also was method to set back the block metadata using that same int metadata value but now we have properties whit object names and values The first i try was to save the block properties as a json file , but i couldn find no way to recreate back the blockstate from the json // ########## ########## ########## ########## public String print() { BlockState blkstate = this.getBlockState(); String json = ""; System.out.println("blkfullname = " + this.get_blkfullname()); int id = Block.getId(blkstate); System.out.println("id = " + id); System.out.println("world = " + this.warudo.isClientSide); System.out.println("pos = " + this.pos); String propiedades = ""; for (Property<?> porp : blkstate.getProperties()) { System.out.println(porp.getName() + " -> " + blkstate.getValue(porp)); propiedades += String.format( ",\"%1$s\":\"%2$s\"", porp.getName(), blkstate.getValue(porp) ); } json = String.format("{\"blockname\":\"%1$s\",\"x\":\"%2$s\",\"y\":\"%3$s\",\"z\":\"%4$s\"%5$s}", this.get_blkfullname(), this.pos.getX(), this.pos.getY(), this.pos.getZ(), propiedades ); System.out.println("\n" + json + "\n" ); return json; } {"blockname":"ender chest","x":"-29","y":"67","z":"53","facing":"north","waterlogged":"false"} {"blockname":"iron trapdoor","x":"-33","y":"67","z":"62","facing":"north","half":"bottom","open":"false","powered":"false","waterlogged":"false"} {"blockname":"stone brick wall","x":"-33","y":"67","z":"60","east":"none","north":"low","south":"none","up":"true","waterlogged":"false","west":"none"} {"blockname":"grass block","x":"-33","y":"66","z":"76","snowy":"false"} {"blockname":"scaffolding","x":"-33","y":"67","z":"76","bottom":"false","distance":"0","waterlogged":"false"} ###################################################################################### The second thing i try was to use the minecraft tools i set some blocks on the ground and save it as a nbt file using a minecraft:structure_block workspace/mod-1.19.2-43.1.3/run/saves/New%20World%20(1)/generated/minecraft/structures/dx.nbt well the guide explains how to spawns the extructure minecraft:dx in to the world using chat commands but there's no mention on how to spawn it from the java code or i overlookit anyway im not native speaker ###################################################################################### i would prefer to make work the first method, briging back the Blockstates from json files looks like i have more control that way but if the second works then works thanks for your time
-
i fond the issue and dont like it in mi words i allways turn down render distance the bobbing effect the particles the shadows and pop up the light level is like a tradition to get the best experience from mi video card soo particles was not rendering coze i set particles to minimun, turn it to max and now it works is weird i could assure than before versions always pops particles from mods wherever the config says
-
g days i need to show a particle at this exact vector but the particle donts spaws or its not visible soo i made this in a custom item to try figure out was wrong // ########## ########## ########## ########## @Override public InteractionResultHolder<ItemStack> use(Level warudo, Player pe, InteractionHand hand) { Vec3 vh = util.calcularVectores(pe, 2 , 0.0F );// if ( vh != null) //warudo.isClientSide && { util.showthis( String.format(" %1$s, %2$s, %3$s", vh.x, vh.y, vh.z ) , pe); warudo.addAlwaysVisibleParticle(ParticleTypes.FLAME, vh.x, vh.y, vh.z , 0.0D, 0.0D, 0.0D); warudo.addParticle(ParticleTypes.SMOKE, vh.x, vh.y, vh.z , 0.0D, 0.0D, 0.0D); pe.playSound(SoundEvents.FIRE_EXTINGUISH, 1.0F, 1.0F); } return InteractionResultHolder.pass(pe.getItemInHand(hand)); } util.calcularVectores(pe, 2 , 0.0F ); just calculate the position 2 meters in from of player if i hold rigth click from time to time i see the flame particle but never see the smoke the sound allways works soo ineed help whith this how i spawn a particle or its now an entity ?
-
i have to make 3 slabs for mi mod so i public static final RegistryObject<Block> DIRT_SLAB = registerBlock("dirt_slab", () -> new SlabBlock(Block.Properties.copy(Blocks.DIRT))); public static final RegistryObject<Block> GRASS_SLAB = registerBlock("grass_slab", () -> new SlabBlock(Block.Properties.copy(Blocks.GRASS))); public static final RegistryObject<Block> GRAVEL_SLAB = registerBlock("gravel_slab", () -> new SlabBlock(Block.Properties.copy(Blocks.GRAVEL))); internally the 3 slabs point to the same 3 parent_model_slab json basemmod:block/parent/slab/parent_slab_bottom.json basemmod:block/parent/slab/parent_slab_double.json basemmod:block/parent/slab/parent_slab_top.json but the grass slab behave as she wants , the size is wrong and the size randomly change every time i put a newone also the block dont have fisical boundaries i cannot step on it also happends when in slab double but the other the dirt one and the gravel one just behave normally as expected ###### how i fix this also is posible to make the grass slab match the bioma color in an easy way i cannot make it work before this dark green texture match the most of forest biomas but not all and gonna looks weird on custome biomas thanks for your time
-
Thanks man now i have something to work whit for( Entry<ResourceKey<Block>, Block> ResourceKey : ForgeRegistries.BLOCKS.getEntries() ) { Block actualBlock = ResourceKey.getValue(); String blockname = "" + actualBlock.getName(); System.out.println( blockname ); if( blockname.contains("deepslate") && blockname.contains("_stairs") ) { break; } }
-
hi i need help whit animating and item i need to animated while on use i having following a tutorial for 1.16.5 making a ModItemModelProperties class and all but dont works for 1.19.2 exactly the ItemModelsProperties.register dont have a source import in 1.16.5 was in import net.minecraft.item.ItemModelsProperties; that means ItemModelsProperties change of name or was dropped and now the bow animation is done diferent also for the sake of saving time surely the way of declaring the item to attach the make_solution_shake(Item item) also change i need an example of the new way thanks for your attention
-
Projectile entity is displayed incorrectly
perromercenary00 replied to Luckydel's topic in Modder Support
hay you have a custome shoot method BulletEntity shoot(Level world, LivingEntity entity, float power, double damage, int knockback, RegistryObject<SoundEvent> soundName, float spreading) the vainilla arrow uses shootFromRotation(Entity le, float rot_pan, float rot_til, float left_offset, float fuerza, float precision) may when you make your custome is passing values to left_offset thing while it must remain in 0.0F -
Get the direction the player is looking.
perromercenary00 replied to Troglodo's topic in Modder Support
well projectiles entities has its own method shootFromRotation float f = 1.0F; arrow.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, f * 3.0F, 1.0F); //i have the hipotesis than p_234612_4_ shifs the arrow vi to the left or right @Override public void shootFromRotation(Entity le, float rot_pan, float rot_til, float p_234612_4_, float fuerza, float precision) { float f = -Mth.sin(rot_til * ((float)Math.PI / 180F)) * Mth.cos(rot_pan * ((float)Math.PI / 180F)); float f1 = -Mth.sin((rot_pan + p_234612_4_) * ((float)Math.PI / 180F)); float f2 = Mth.cos(rot_til * ((float)Math.PI / 180F)) * Mth.cos(rot_pan * ((float)Math.PI / 180F)); this.shoot((double)f, (double)f1, (double)f2, fuerza, precision); Vec3 vector3d = le.getDeltaMovement(); this.setDeltaMovement(this.getDeltaMovement().add(vector3d.x, le.isOnGround() ? 0.0D : vector3d.y, vector3d.z)); } -
[1.16.5]How to solve Exception in thread "main" ?
perromercenary00 replied to user9934's topic in Modder Support
based on the log i think theres an error on curios.mixins.json file -
// ########## ########## ########## ########## @Override public InteractionResultHolder<ItemStack> use(Level warudo, Player pe, InteractionHand hand) { ItemStack itemstack = pe.getItemInHand(hand); pe.setXRot(pe.getXRot() - 15.0F); } //why xrot makes steve move its head up an down and not left and right // i thing someone messe that up
-
well thats its i need to get the block or the default.blockstate from a block i only have an string "deepslate_bricks" "deepslate_brick_stairs" "deepslate_brick_slab" soo i create a map taken the internal of the block class and using regexp and awk i made this and after i realize is stupid and also dont include moded blocks i say to miself probably minecrafs already has a way of doing this lets ask for it in the forums basically i need per example i have this deepslate_brick block and to level the terrain i need to set some slabs around soo ineed to get the corresponding slab type to deepslate_brick to doo that i would have to search in the list for keys containing the word "deepslate_brick" and the word slab also not all blocks have slabs and stairs
-
[1.16.5]How to solve Exception in thread "main" ?
perromercenary00 replied to user9934's topic in Modder Support
if you text the curios.mixins.json file on https://jsonchecker.com/ it pass or not