Jump to content

perromercenary00

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. yaa i notice that but if i invert it , it moves the bow model up causing the same problem as it happend in the minecraft game ################################################################### AAAiiiiiiiiiiiiiiiiiiiiiiiiiiiaaiiiiiiiiiiiiiiiia yap is the optifine mod i delete the all the .minecraft folder and download again all the game again an put only mi bow mod, its working as intended so i begin to add the others mods one by one to see what happends and afther OptiFine_1.19.2_HD_U_H9.jar it fails again soo its optifine must be some option messing up whit the shouldCauseReequipAnimation thing anyway the pickaxe keeps failing i change the warhammer to be also an pickaxe and fail as well public static final RegistryObject<Item> PICKAXE_STEEL = ITEMS.register("pickaxe_steel", () -> new PickaxeItem(MTiers.STEEL_SMALL, 1, -2.8F, (new Item.Properties().tab(tab.instance) ))); public static final RegistryObject<Item> WARHAMMER_STEEL = ITEMS.register("warhammer_steel", () -> new PickaxeItem(MTiers.STEEL, 1, -2.8F, (new Item.Properties().tab(tab.instance) )));
  2. Im trying to realese code a been working for like 8 months but having weird small problems and to add salt to the wound mi hard disk fails this morning and cost me to recover mi work lest talk about this one first in eclipse the code just works nice and all soo lets build the debt to test it on minecraft and make some videos to show the mod on curse now all the bows gets displaced upside in a weird angle [explaining whit patience] the mod works perfectly fine in eclipse ide, but afther build it on and paste into minecraft folder this exactly piece of code stops working #########################################################################3 @Override public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { //return ( oldStack.getItem() == newStack.getItem() )? true : false; return ( newStack.getItem() instanceof bow00 )? true : false; } i use this piece of code to avoid the bows to going down and up everitime i write change nbt data in the bow is an old history but in minecraft game it dont works and i dont know why this method is added by the IForgeItem class so i implement it again in mi bow class "even knowing is alredy implemented by the item super class" public class bow00 extends BowItem implements IForgeItem { [/explaining whit patience] again the method shouldCauseReequipAnimation() works perfect inside the eclipse ide but not in the minecraft game runing forge ################################################################################################### the next thing this is just a custome iron pickaxe whit double the duration it works just fine in eclipse but afther build and put inside minecraft if stop being a pickaxe it takes too mutch to break the block and the block dont drops weir it is coze the rest of tools works fine , steel_shovel steel_axe steel_hoe works as intended inside minecraft this its not custome code its just extending the vainilla PickaxeItem public static final RegistryObject<Item> PICKAXE_STEEL = ITEMS.register("pickaxe_steel", () -> new PickaxeItem(MTiers.IRON, 1, -2.8F, (new Item.Properties().tab(tab.instance) ))); theres a third thing but probably the same reason ############################## at this point i dont know what to ask for why this things works in eclipse but no in the minecraft game is a kind of forge bug or its some how a modder error ?
  3. good days i currently working in 3 mods ["Mercenary's Bow Mod"] "Mercenary's Tools Mod" "Mercenary's Blocks Mod" and i want to run the 3 mods in eclipse editor at same time to see how they interact soo mi first try was to load the code for the 3 mods at same time and run it together it don't show error but in every try i made it only runs the last added mod in this case the tools mod ################################################################################3 in mi second try i just load one mod in eclipse the "Mercenary's Bow Mod" and the other two where build as jar and put inside the run/mods folder bows/forge-1.19.2-43.2.1-mdk/run/mods/mercenary_blocks_1.19.2-002.jar bows/forge-1.19.2-43.2.1-mdk/run/mods/mercenary_tool_1.19.2-002.jar if i try to run the code it crash and i get an the error is so long the first part gets overwritten this even happens when running the code whit just one mod in to the run folder bows/forge-1.19.2-43.2.1-mdk/run/mods/mercenary_tool_1.19.2-002.jar it happends as well whit any downloaded mod i put on the run/mods folder is there way to do this ?? to put many mods and run them together while inside the eclipse ide !
  4. yesterday night i made some other post and they give me the render class for the fireball so i get know how to make the icon entity glow in the dark just add this two methods to the icon_entity_renderer class @Override protected int getBlockLightLevel(T icon_entity, BlockPos pos) { return this.fullBright ? 15 : super.getBlockLightLevel(icon_entity, pos); } @Override protected int getSkyLightLevel(T icon_entity, BlockPos pos) { return icon_entity.level.getBrightness(LightLayer.SKY, pos); //return 15; } its just not what i spected i just make the skull texture glow and are visible in dark and all but it don't emit any light soo i bring in a blaze and its the same thing is visible but don't shines anyway being visible in the dark is enough for this case
  5. i think an i3 whit an nvidia gtx720 would be enought to play without shaders or fancy sttuf
  6. i need to find the class where minecrafts define the render and the model for the fireball entity im using eclipse and search for the thing using [ctrl] + [alt] + [T] but only find the net.minecraft.world.entity.projectile.Fireball; class and the class where it declares all the entities but not luck finding the renderer class for the fireball or maybe is something without the world fireball on it ? well thanks for your time
  7. it start whit net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file iceandfire-client.toml of type CLIENT for modid iceandfire iceandfire-client.toml soo the first would be to check if src/main/resources/META-INF/mods.toml exist and its not fucked upon
  8. good days i try to make the question shortest possible i redooo mi bow|crossbow|arrow to 1.19 version this costume arrow has 2 particularities, * when hit something it rolls a d20 int d20 = (1 + ((int) (Math.random() * 20))); and if its more than 17 doubles the damage * using math detects if the hits its a head-shoot and if it is it also doubles damage so i made code way if head-shoot at same times than critical does one shoot kill for anything under 26hp like witches way it has not effect on guardians brutes or custom bosses ##### now obviously i wanna has some kind mark to indicator wheres is a critical headshoot soo i made a custome SKULL_PARTICLE Is nice and all it glows soo is visible in the dark and fade away # but has a problem it just spawns wherever it feels like like 70% of the time don't works so i try to spawn it multiple times for( int i = 0 ; i < 5 ; i++ ) { this.level.addAlwaysVisibleParticle(ParticleInit.SKULL_PARTICLE.get(), eye.x, eye.y, eye.z, 0.0D, 0.0D, 0.0D); } but it has a ugly washed away looks and thats when it feels like spawning first 3 times it works last 2 dont's works #################### i get boored and change of tactic i take the arrow render class twerkit change texture and create an icon-entity only for the sole purpose of showing and skull when critical head-shoot this one works 100% of times also the true was easy to make the icon-entity than the skull-particle the problem whit this one is i dont know how to make it glow or fade away this one just dissapears ############################################################################################################ ############################################################################################################ ############################################################################################################ if do you reach to this point thanks for you time this posted question has two possible solutions one is to find a way to force the particle to spawn one time something like //try 10 times to spawn the particle for( int i = 0 ; i < 10 ; i++ ) { if( this.level.addAlwaysVisibleParticle(ParticleInit.SKULL_PARTICLE.get(), eye.x, eye.y, eye.z, 0.0D, 0.0D, 0.0D) ){ //if particle spawn stop trying break; } } Can you guide me whit this the other way be made the icon-entity Glow in the dark and fade away the glow effect must be applied to the icon_entity_model class i don't have idea how to do it and i alredy ask this before without avail over the two i would prefer to fix the icon-entity and make it glow, this one would work even if the user disables the particles thanks for your time
  9. sounds like a ben10 thing i think the clock must be a transparent armor whit only the arm part and the gui part must be trigger by a custome keybind to the keyboard key you like more
  10. thanks for asking i was looking to the forge class code and see the attributes and seems complicated to get them change them and apply to player also the original value needs to be stored somehow soo it can be restored when player deselect the lance event its the easy part @SubscribeEvent public static void on_using_lance(LivingEquipmentChangeEvent event) { ItemStack itemstack = event.getTo(); Entity entity = event.getEntity(); Level warudo = entity.level; if (entity instanceof Player) { // if (itemstack.getItem() == ItemInit.LANCE_STEEL.get() && // !warudo.isClientSide) { if (itemstack.getItem() instanceof LanceItem && !warudo.isClientSide) { System.out.println("\nEs una lanza\n"); //IForgePlayer.getReachDistance(); } else { //set back the original values } } } i need help whi the forge class part but also really really theres no replace to detect when players leftclick whit an item ?
  11. good nights i made a custome lance item and need to make it has a longer reach soo it can hurt zombies at 6 or 7 meters the SwordItem only has 4 maybe 5 meters reach lokking into mi old code the function name was public boolean onEntitySwing(EntityLivingBase shootingEntity, ItemStack pistola) soo what function is trigered on left click ?
  12. i see that error in mod and was coze therwas missing the json defining the texture for the particle in mi case src/main/resources/assets/mercbow/particles/skull_particle.json { "textures": [ "basemmod:skull_particle" ] }
  13. haa that was i move all the tags files to the forge folder and know the recipe works { "type": "minecraft:crafting_shaped", "pattern": [ " K", " R ", "R " ], "key": { "K": { "tag": "forge:knifes/steel" }, "R": { "tag": "forge:rods/carbon" } }, "result": { "item": "merctool:lance_steel", "count": 1 } }
  14. hai i'm doing some tools and weapons for the mod then comes the recipes i want this items recipes to use minecraft tags way the recipes keeps working even if another mod cames an overrides the base materials as you can see the knife recipe works the battleaxe recipe works but the lance recipe don't works this mod is named merctool i have spend like a day triying things like moving the knife tag to the merctool folder dobble and trippple check item names and routes dont works and dont know why the knife { "type": "minecraft:crafting_shaped", "pattern": [ " S ", " R " ], "key": { "S": { "tag": "minecraft:ingots/steel" }, "R": { "tag": "minecraft:rods/carbon" } }, "result": { "item": "merctool:knife_steel", "count": 1 } } the battleaxe { "type": "minecraft:crafting_shaped", "pattern": [ "S S", "SRS", " R " ], "key": { "S": { "tag": "minecraft:ingots/steel" }, "R": { "tag": "minecraft:rods/carbon" } }, "result": { "item": "merctool:battleaxe_steel", "count": 1 } } the lance { "type": "minecraft:crafting_shaped", "pattern": [ " K", " R ", "R " ], "key": { "K": { "tag": "minecraft:knifes/steel" }, "S": { "tag": "minecraft:ingots/steel" }, "R": { "tag": "minecraft:rods/carbon" } }, "result": { "item": "merctool:lance_steel", "count": 1 } } tags steel ingot src/main/resources/data/minecraft/tags/items/ingots/steel.json { "replace": false, "values": [ "merctool:ingot_steel" ] } tags rod carbon src/main/resources/data/minecraft/tags/items/rods/carbon.json { "replace": false, "values": [ "merctool:rod_carbon" ] } tags knifes steel src/main/resources/data/minecraft/tags/items/knifes/steel.json { "replace": false, "values": [ "merctool:knife_steel" ] } can you help whit it can you see whats missing/wrong ?? thanks for your time
  15. this block is a common block its weird how it dont work if i just put the code on public BlockState getStateForPlacement(BlockPlaceContext context) {} thats why i think there exist some pseudo Levels only having access to reduced part of database soo i was using the tick the button and the presure plate use to reset to normal thats how i manage to set the ladder blocks and retrieve them ########################### from the minecraft terrain generation i dont think its gonna fit mi desires is like a mi thing i want the main area round, circular and i want the area leveled using slabs so the max inclination goes to like 22.5 degrees way the village looks always different based on the previous terrain characteristics sorry i dont speak english so mi gramatical thing is wrong i need to fix the grass slab color thing is weird how it looks when the grass has two diferent colors ############################ anyway let say i change from a common block to an TileEntity block and make it detonate at 10 ticks of existing the extructure its 25chunks big #################################################################################################### soo i need way to check if those chuncks alredy exist and if not i need to force minecraft to generate those chunks can you help me whit those two things
  16. using the tall towers example i wanna spawn a complex villages like old version 1.8 the plan until now consist on making a especial block to do all the job following the steps * fix and level up the land to remove the stepped parts and pitfalls * spawn village fence in the borders * spawn the sewer tunnels * spawn the gravel / compacted grass paths * houses * villagers / animals and spawn that block in the world using the datapacks system this is what i have the data packs works and spawn the block in the world but the blocks dont pops up at this point only has the code to level up the terrain ###### the trouble seem like data packs put blocks in the world without triggering the internal block i try this tree things but nothing triggers // ########## ########## ########## ########## public void tick(BlockState blkstate, ServerLevel warudo, BlockPos blkpos, RandomSource randomsource) { System.out.println("\n\ntick()\n\n"); warudo.setBlock(blkpos, Blocks.AIR.defaultBlockState(), 10); AreaCircular ac = new AreaCircular(warudo); ac.setRadio(32.0F); ac.aplanar_area_circular(blkpos); ac.bm.setBlocks(); } @Override public void setPlacedBy(Level warudo, BlockPos blkpos, BlockState p_49849_, @Nullable LivingEntity p_49850_, ItemStack p_49851_) { System.out.println("\n\nsetPlacedBy()\n\n"); warudo.setBlock(blkpos, Blocks.AIR.defaultBlockState(), 10); AreaCircular ac = new AreaCircular(warudo); ac.setRadio(32.0F); ac.aplanar_area_circular(blkpos); ac.bm.setBlocks(); } @Override public void onPlace(BlockState p_60566_, Level warudo, BlockPos blkpos, BlockState p_60569_, boolean p_60570_) { System.out.println("\n\nonPlace()\n\n"); warudo.setBlock(blkpos, Blocks.AIR.defaultBlockState(), 10); AreaCircular ac = new AreaCircular(warudo); ac.setRadio(32.0F); ac.aplanar_area_circular(blkpos); ac.bm.setBlocks(); } ##### may the block spawn process in a pseudo level of something i dont know i need way to trigger the block on spawn and launch ac.aplanar_area_circular(blkpos); to start the process thanks for your time
  17. yaa thats what i was looking for i change the code to work mi style i find than for some reason the vainilla BlockState.rotate() method dont works for mi custome blocks but just work around it package basemmod.util; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Optional; import java.util.Set; import net.minecraft.client.Minecraft; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.nbt.NbtIo; import net.minecraft.nbt.NbtUtils; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.Resource; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.util.StringRepresentable; import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; public class NbtStructure { public LevelAccessor warudo = null; public LevelAccessor getWarudo() { return warudo; } public void setWarudo(LevelAccessor warudo) { this.warudo = warudo; } public String modname = "basemmod"; public String structureName = ""; public Rotation rot = Rotation.NONE; private int ci_x = 0; private int ci_y = 0; private int ci_z = 0; // ########## ########## ########## ########## ########## ########## // BlockMap part // ########## ########## ########## ########## ########## ########## // X Z Y private Map<Integer, Map<Integer, Map<Integer, BlockState>>> map = new HashMap<Integer, Map<Integer, Map<Integer, BlockState>>>(); // Z Y private Map<Integer, Map<Integer, BlockState>> X = new HashMap<Integer, Map<Integer, BlockState>>(); // Y private Map<Integer, BlockState> Z = new HashMap<Integer, BlockState>(); public Set<BlockPos> block_list = new HashSet<BlockPos>(); private BlockState blkstate = null; private BlockPos blkpos = null; private ResourceManager resourceManager = null; // ########## ########## ########## ########## // sets the blockstate for this blockpos in the blockmap public boolean setBlockState(BlockPos pos, BlockState value) { return setBlockState(pos.getX(), pos.getY(), pos.getZ(), value); } public boolean setBlockState(int bx, int by, int bz, BlockState value) { X = map.get(bx); if (X == null) { X = new HashMap<Integer, Map<Integer, BlockState>>(); map.put(bx, X); } if (X != null) { Z = X.get(bz); if (Z == null) { Z = new HashMap<Integer, BlockState>(); X.put(bz, Z); } if (Z != null) { Z.put(by, value); this.block_list.add(new BlockPos(bx, by, bz)); return true; } } return false; } // ########## ########## ########## ########## // return the blockstate for this blockpos from the blockmap public BlockState getBlockState(BlockPos pos) { BlockState blkstate = getBlockState(pos.getX(), pos.getY(), pos.getZ()); return blkstate; } public BlockState getBlockState(int bx, int by, int bz) { BlockState blkstate = null; X = map.get(bx); if (X != null) { Z = X.get(bz); if (X != null) { blkstate = Z.get(by); } } return blkstate; } public void print() { int count = 0; for (BlockPos cursor : block_list) { System.out.print("\n" + count + ") "); System.out.print(cursor.getX() + ", "); System.out.print(cursor.getY() + ", "); System.out.print(cursor.getZ() + " : "); System.out.print(get_blkfullname(this.getBlockState(cursor)) + "\n"); count++; } } // ########## ########## ########## ########## ########## ########## // main constructor // NBT part // ########## ########## ########## ########## ########## ########## public NbtStructure(Level warudo, String structureName) { this.warudo = warudo; this.getResourceManager(); this.structureName = structureName; getBuildingBlocks(this.structureName); this.print(); } public NbtStructure(Level warudo, String structureName, BlockPos cornerstone, Rotation rot) { this.warudo = warudo; this.getResourceManager(); this.ci_x = cornerstone.getX(); this.ci_y = cornerstone.getY(); this.ci_z = cornerstone.getZ(); this.rot = rot; this.structureName = structureName; getBuildingBlocks(this.structureName); this.print(); } public NbtStructure(Level warudo, String structureName, BlockPos cornerstone, Direction facing) { switch (facing) { default: case UP: case DOWN: case SOUTH: this.rot = Rotation.NONE; break; case NORTH: this.rot = Rotation.CLOCKWISE_180; break; case EAST: this.rot = Rotation.COUNTERCLOCKWISE_90; break; case WEST: this.rot = Rotation.CLOCKWISE_90; break; } this.warudo = warudo; this.getResourceManager(); this.ci_x = cornerstone.getX(); this.ci_y = cornerstone.getY(); this.ci_z = cornerstone.getZ(); this.structureName = structureName; getBuildingBlocks(this.structureName); this.print(); } // ########## ########## ########## ########## ########## ########## public ResourceManager getResourceManager() { if (resourceManager == null) if (this.warudo.isClientSide()) this.resourceManager = Minecraft.getInstance().getResourceManager(); else this.resourceManager = this.warudo.getServer().getResourceManager(); return resourceManager; } // ########## ########## ########## ########## ########## ########## // load blocks from nbt.file to the blockmap // ########## ########## ########## ########## ########## ########## public void getBuildingBlocks(String structureName) { CompoundTag nbt = getBuildingNbt(structureName); if (nbt == null) { System.out.println(" Structure not find "); return; } // load in blocks (list of blockPos and their palette index) ListTag blocksNbt = nbt.getList("blocks", 10); ArrayList<BlockState> palette = getBuildingPalette(nbt); for (int i = 0; i < blocksNbt.size(); i++) { CompoundTag blockNbt = blocksNbt.getCompound(i); ListTag blockPosNbt = blockNbt.getList("pos", 3); blkstate = palette.get(blockNbt.getInt("state")); blkpos = new BlockPos(blockPosNbt.getInt(0), blockPosNbt.getInt(1), blockPosNbt.getInt(2)); // rotate blkstate = rotate_blockstate(blkstate, this.rot); blkpos = rotate_blockpos(blkpos, this.rot); // fit to corner stone block blkpos = (new BlockPos((blkpos.getX() + this.ci_x), (blkpos.getY() + this.ci_y), (blkpos.getZ() + this.ci_z))); // save to the hash map this.setBlockState(blkpos, palette.get(blockNbt.getInt("state"))); block_list.add(blkpos); // warudo.setBlock(blkpos, blkstate, 10); } } // ########## ########## ########## ########## ########## ########## // writte the blocks to the world // ########## ########## ########## ########## ########## ########## public void setBlocks() { BlockState cursorstate = null; FluidState fluidstate = null; boolean waterlogged = false; for (BlockPos cursor : this.block_list) { cursorstate = this.getBlockState(cursor); waterlogged = false; // especial blocks and stuff if (cursorstate.hasProperty(BlockStateProperties.WATERLOGGED)) { waterlogged = cursorstate.getValue(BlockStateProperties.WATERLOGGED); if (!waterlogged) { fluidstate = this.warudo.getFluidState(cursor); if (fluidstate.getType() == Fluids.WATER) { cursorstate = cursorstate.setValue(BlockStateProperties.WATERLOGGED, true); } } } this.warudo.setBlock(cursor, cursorstate, 10); } } // ########## ########## ########## ########## ########## ########## // ########## ########## ########## ########## ########## ########## public CompoundTag getBuildingNbt(String structureName) { try { ResourceLocation rl = new ResourceLocation(this.modname, "structures/" + structureName + ".nbt"); Optional<Resource> rs = this.resourceManager.getResource(rl); return NbtIo.readCompressed(rs.get().open()); } catch (Exception e) { // System.out.println(e); return null; } } // ########## ########## ########## ########## ########## ########## public ArrayList<BlockState> getBuildingPalette(CompoundTag nbt) { ArrayList<BlockState> palette = new ArrayList<>(); // load in palette (list of unique blockstates) ListTag paletteNbt = nbt.getList("palette", 10); for (int i = 0; i < paletteNbt.size(); i++) palette.add(NbtUtils.readBlockState(paletteNbt.getCompound(i))); return palette; } // ########## ########## ########## ########## public BlockState rotate_blockstate(BlockState blkstate, Rotation rot) { // Direccion Direction facing = null; if (blkstate.hasProperty(BlockStateProperties.FACING)) { facing = blkstate.getValue(BlockStateProperties.FACING); } if (blkstate.hasProperty(BlockStateProperties.HORIZONTAL_FACING)) { facing = blkstate.getValue(BlockStateProperties.HORIZONTAL_FACING); } Direction.Axis axix = null; if (blkstate.hasProperty(BlockStateProperties.AXIS)) { axix = blkstate.getValue(BlockStateProperties.AXIS); } if (blkstate.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) { axix = blkstate.getValue(BlockStateProperties.HORIZONTAL_AXIS); } if (facing != null && facing != Direction.UP && facing != Direction.DOWN) { switch (rot) { default: NONE: // du nothing break; case CLOCKWISE_180: facing = facing.getOpposite(); break; case CLOCKWISE_90: facing = facing.getClockWise(); break; case COUNTERCLOCKWISE_90: facing = facing.getCounterClockWise(); break; } if (blkstate.hasProperty(BlockStateProperties.FACING)) { blkstate = blkstate.setValue(BlockStateProperties.FACING, facing); } if (blkstate.hasProperty(BlockStateProperties.HORIZONTAL_FACING)) { blkstate = blkstate.setValue(BlockStateProperties.HORIZONTAL_FACING, facing); } } // axis // Direction.Axis.valueOf(value.toUpperCase()) if (axix != null) { switch (axix) { default: case Y: // du nuthing break; case X: axix = Direction.Axis.Z; break; case Z: axix = Direction.Axis.X; break; } if (blkstate.hasProperty(BlockStateProperties.AXIS)) { blkstate = blkstate.setValue(BlockStateProperties.AXIS, axix); } if (blkstate.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) { blkstate = blkstate.setValue(BlockStateProperties.HORIZONTAL_AXIS, axix); } } // this thing dont works on mod made blocks if (axix == null && facing == null) { blkstate.rotate(rot); } return blkstate; } // ########## ########## ########## ########## public BlockPos rotate_blockpos(BlockPos cursor, Rotation rot) { switch (rot) { default: // case NORTH: // du nuthing break; case CLOCKWISE_90: cursor = new BlockPos(cursor.getZ() * -1, cursor.getY(), cursor.getX()); break; case CLOCKWISE_180: cursor = new BlockPos(cursor.getX() * -1, cursor.getY(), cursor.getZ() * -1); break; case COUNTERCLOCKWISE_90: cursor = new BlockPos(cursor.getZ(), cursor.getY(), cursor.getX() * -1); break; } return cursor; } // ########## ########## ########## ########## ########## ########## // ########## ########## ########## ########## ########## ########## // public static String get_blkfullname(BlockState blkstate) { if (blkstate == null) { return "NULL"; } String nnn = "" + blkstate.getBlock().getName().getString().toLowerCase(); return fix_blkfullname(nnn); } // ########## ########## ########## ########## ########## ########## // 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(); } // ########## ########## ########## ########## // ########## ########## ########## ########## public static BlockPos chunk_northwest_corner(Level warudo, BlockPos pos) { BlockPos min = null; int subx = 0; int subz = 0; int abs = 0; int factox = 0; int factoz = 0; // si el valor es negativo if (pos.getX() < 0) { abs = Math.abs(pos.getX()); factox = (abs / 16); factox = ((abs % 16) > 0) ? factox + 1 : factox; subx = -16 * factox; } else { subx = pos.getX() - (pos.getX() % 16); } // si el valor es negativo if (pos.getZ() < 0) { abs = Math.abs(pos.getZ()); factoz = (abs / 16); factoz = ((abs % 16) > 0) ? factoz + 1 : factoz; subz = -16 * factoz; } else { subz = pos.getZ() - (pos.getZ() % 16); } min = new BlockPos(subx, pos.getY(), subz); return min; } // ########## ########## ########## ########## ########## ########## // ########## ########## ########## ########## ########## ########## // ########## ########## ########## ########## ########## ########## // ########## ########## ########## ########## ########## ########## } // ########## ########## ########## ########## @Override public InteractionResultHolder<ItemStack> use(Level warudo, Player pe, InteractionHand hand) { Target target = new Target(warudo, pe, 20); //spanw full chunk structure aligned whit borders if(!warudo.isClientSide) { Postate postate = target.get_postate(); //Direction facing = pe.getDirection(); BlockPos min = NbtStructure.chunk_northwest_corner( warudo, postate.get_blockpos() ); NbtStructure structure = new NbtStructure(warudo, "empty_chumk", min, Direction.SOUTH ); structure.setBlocks(); //write the bocks } return InteractionResultHolder.pass(pe.getItemInHand(hand)); }
  18. hay good nights i made an structure and save it to nbt using the minecraft:StructureBlock the idea basically is a sewer i have to made all the sections and later joint them in the level i wanna to create a wand to spawn this same structure on right click and i need to apply the offset soo the sewer section spawn buried underground i put the nbt file in /src/main/resources/data/basemmod/structures/tunel_i.nbt but i dont know how to call it from code to make it spanw in the world i need something like // ########## ########## ########## ########## @Override public InteractionResultHolder<ItemStack> use(Level warudo, Player pe, InteractionHand hand) { System.out.println("use( Spawn Structure at target Block using Player.getDirection() to define rotation );"); Target target = new Target(warudo, pe, 20); Vec3 vh = target.getVh();// util.calcularVectores(pe, 10 , 0.0F );// System.out.println("use();" + warudo.isClientSide ); if(!warudo.isClientSide) { IdontKnowWhatClass idkn = IdontKnowWhatClass.loadStructure("basemmod:tunel_i"); idkn.setPosition( target.getBlockPos() ); idkn.setOffset( -2, - 6, 0 ); idkn.spanwStructure(); } return InteractionResultHolder.pass(pe.getItemInHand(hand)); } thanks for your attention
  19. ?? java models shield is an entity but you can just put an normal item model and left the entity translucent thats wat im doing
  20. Im trying to make an costume shield model the thing is i want it to have a curved form and round corners as this one im using blockbench for this and is i made the shield side whit round borders and try to rotate 22.5 in Y its fucks up the corner blocks iT like a cube cannot have more than one rotation aniway i been seen mods whit nice modeled items what are they using
  21. ya i found it mi base class was lacking client side @Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public static class ClientModEvents { @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { ModItemModelProperties.make_shield_shield( ItemInit.CARBON_SHIELD.get() ); } } now i have some issues whit the model position and textures
  22. forgive the clumsines also i dont speak the languague i could'n figure out by miself how to make a item to change the model based on the state im making a custome shield just extending the vainilla shield it works blocks arrows and all now i want the shield to have 2 states two jsons one for when relaxed and the other json model for when shielding those two models individually works as the videos prove know the troubles come here becoze from this point i dont understand a thing first of all the two models are named "basemmod:item/carbon_shield_relaxed" "basemmod:item/carbon_shield_blocking" then im using the itembow as a base soo i let the shield whit same properties as the bow ############ first problem based on answer from previous post i made a custome ModItemModelProperties class but i dont have the lesser idea of how to apply this to the shield item public class ModItemModelProperties { //###### ###### ###### ###### ###### ###### public static void make_shield_shield(Item shield) { ItemProperties.register(shield, new ResourceLocation("pull"), (itemstack, warudo, le, p_174638_) -> { //ItemModelsProperties.register(item, new ResourceLocation("pull"), (itemstack, warudo, le) -> { if (le == null) { return 0.0F; } else { float pull = (float)((( itemstack.getUseDuration() - le.getUseItemRemainingTicks() ) % 5 ) / 5.0F); //System.out.println( " ticks = " + pull ); return (le.getUseItem() != itemstack )? 0.0F : pull; //(itemstack.getUseDuration() - le.getUseItemRemainingTicks()) / 20.0F; } }); ItemProperties.register(shield, new ResourceLocation("pulling"), (itemstack, warudo, le, p_174638_) -> { //ItemModelsProperties.register(item, new ResourceLocation("pulling"), (itemstack, warudo, le) -> { return (le != null && le.getUseItem() == itemstack) ? 1.0F : 0.0F; }); } } where this class must gooo and how i declare it to works whith the shield ???? i made the parent json this way but donts work the shield is invisible i think is coze the missing step from the ModelProperties class before may it has also some errors i dont know yet { "overrides": [ { "predicate": { "pulling": 0 }, "model": "basemmod:item/carbon_shield_relaxed" }, { "predicate": { "pulling": 1, "pull": 0.1 }, "model": "basemmod:item/carbon_shield_blocking" } ] } the shield item is invisible carbon_shield_blocking ########## ########## ########## ########## may the question be wrong formulated soo sorry before hand basically i want this shield to apply one of two json models based on if the item is in use
  23. ja thanks thats what i need @Override public InteractionResult use(BlockState blkstate, Level warudo, BlockPos pos, Player pe, InteractionHand hand, BlockHitResult hit) { ItemStack itemstack = pe.getItemInHand(hand); if (!warudo.isClientSide) { System.out.println("\n\n use("+ itemstack.getDisplayName().getString() +")\n\n"); if( itemstack.getItem() == BlockInit.OAK_STEEP_LADDER.get().asItem() ) { System.out.println("\n use(Es una escalera )\n"); } if( itemstack.getItem() == Blocks.AIR.defaultBlockState().getBlock().asItem() ) { System.out.println("\n use(Es AIRE )\n"); } } an empty hand returns a block of air thats weird but it works
  24. hi good days i made this custom mesh i made for a chicken farm @Override public void fallOn(Level warudo, BlockState blkstate_, BlockPos pos_, Entity en, float p_152430_) { en.causeFallDamage(p_152430_, 1.0F, DamageSource.FALL); System.out.println( "Fall On " + warudo + " ·>" + en.getName().getString() ); } the other thing i try was to catch the event but dont know whats the event and on_toss(ItemTossEvent event) only works when player drops something whit Q
  25. hi i have this block is a custome ladder block (BlockInit.OAK_STEEP_LADDER) and i need to know if player is right clicking the ladder whit another ladder of the same kind or the hand is empty the think is i have the reference to mi custome block as a block from mi blockInit class the thing i get from the hand is an item instance i cannot compare blocks to items how i get the itemblock from the block instance? and by the way i also need to know if the hand is empty to return the block as an item to user hand // ########## ########## ########## ########## // Onright click @Override public InteractionResult use(BlockState blkstate, Level warudo, BlockPos pos, Player pe, InteractionHand hand, BlockHitResult hit) { ItemStack itemstack = pe.getItemInHand(hand); if (!warudo.isClientSide) { System.out.println("\n\n use("+ itemstack.getDisplayName().getString() +")\n\n"); if( itemstack.getItem() == BlockInit.OAK_STEEP_LADDER.get??? ) { //do things } } return InteractionResult.sidedSuccess(warudo.isClientSide); // } thank for our attention
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.