Jump to content

perromercenary00

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. i have it as a class in the main mod folder but dont seems to matter whats is the location /home/usuario/workspace/1.20.4/mercmod/src/main/java/mercmod/ColorHandler.java "src/main/java/mercmod/ColorHandler.java" i can not get the item color part to work this is mi grass slab As block when placed it takes the corresponding bioma grass color its fine as item in the inventory or the hotbar and as entityItem dont takes the color is just gray
  2. im following this case coze removing the material class from the code fucks up mi items that depends on it i need to find a replacement for the Material class this is an old item from back 1.8 when turn on hold right click it checks the target block and if its made of wood it changes to cutting animation Material pmat = blkstate.getMaterial(); if (pmat == Material.WOOD){ //then cut it down } this other one checks for dirt or stone its no supposed to work on metal or wood what i could use ?
  3. ya ya i get it boolean find = false; int count = 0; BlockState dblkstate; BlockPos bpos = null; BlockPos dpos = null; for(BlockPos cursor : todos_los_blockes ){ dpos = cursor; target.particle(cursor.getCenter()); dblkstate = warudo.getBlockState(cursor); if( !dblkstate.canBeReplaced() ){ //<---------- //if( dblkstate .getBlock() instanceof tubo ){ find = true; break; } bpos = cursor; count ++; } for this case setting blocks i can know discrimaniting by the canbereplaced tag thanks
  4. can we have a example of that for item inever could make it work for item for blocks i got this
  5. at the use method of the block you must check if the block above or below is a furnace whit the same facing // ########## ########## ########## ########## // On right click @Override public InteractionResult use(BlockState blkstate, Level warudo, BlockPos pos, Player pe, InteractionHand hand, BlockHitResult hit) { //System.out.println("use()"); ItemStack helditem = pe.getItemInHand(hand); int age = blkstate.getValue(AGE); if( !warudo.isClientSide() ){ BlockState blockabove = warudo.getBlockState( pos.above() ); BlockState blockbelow = warudo.getBlockState( pos.below() ); //stuff //stuff //stuff
  6. Good dais this is it i wanna update the briefcase from mi mod this class "NetworkHooks" is resposible for open the screen this class don't exist anymore in 1.20.4 or it is in another place and/or whit another name i check kapenjou tutorials an hes using this same class same place but hes using 1.20.1 so something change from 1.20.1 to 1.20.4 or mi setup is missing something ----------------------------------------------------------------------------------------- thanks for your reading ¿ i need to find if the class was dropped now what replace it ¿ or if it change of location where it is know ¿ or confirm mi setup is lacking or wrong i have intellij 2023.1.1 comunity whit forge-1.20.4-49.0.26-mdk
  7. no thats not // ########## ########## ########## ########## @Override public boolean canBeReplaced(BlockState p_56373_, BlockPlaceContext p_56374_) { return false; } this is the check to select if wanna reset the block or put another on top of the block i need something to know what is a block made of
  8. the removing of the Material class has mess up bad mi code now have to many broken things after updating mi code to 1.20.4 this are mi pipes they conect each others but to have it right i have to made a custome BlockItem the thing its that i need to check the block im looking at if its some something like grass or wheat i need to ignore and replace whit mi pipe block but if its something like leaves then it must respect it and set the pipe above or at the side in x < 1.9just check the material the target block is made of in 1.20 cannot be done like this soo i was trying to make a list of solid blocks but is much work and also it don't have in account blocks from other mods
  9. could it be by making a custome block whit no hitbox or by a falling block entity // ########## ########## ########## public FallingBlockEntity create_FallingBlock(BlockPos cursor){ this.fallingblock = FallingBlockEntity.fall(warudo, cursor, this.getBlockState() ); this.fallingblock.setNoGravity(true); warudo.addFreshEntity(this.fallingblock); return this.fallingblock; }
  10. in 1.19 i notice that an have to fix by hand in 1.20.4 this is not a problem anymore but 1.20 has its own set of new problems // ########## ########## ########## ########## // lista de entidades atravezadas por la linea entre vi y vh|vo public ArrayList<LivingEntity> findHitEntitys() { return findHitEntitys(0.0D); } public ArrayList<LivingEntity> findHitEntitys(double grow) { double hgrow = (grow/2) * -1; Vec3 vi = this.subject.getEyePosition(); Vec3 vo = (this.vh != null) ? this.vh : this.vo; /* Double xn = Math.min(vi.x, vo.x); Double xm = Math.max(vi.x, vo.x); Double yn = Math.min(vi.y, vo.y); Double ym = Math.max(vi.y, vo.y); Double zn = Math.min(vi.z, vo.z); Double zm = Math.max(vi.z, vo.z); Vec3 vdi = new Vec3(xn,yn,zn); Vec3 vdo = new Vec3(xm,ym,zm); */ // particle(warudo, vo); AABB bb = new AABB(vi, vo).inflate(2.0D); //System.out.println( (bb.maxX - bb.minX) + ", " + (bb.maxY - bb.minY) + ", " + (bb.maxZ - bb.minZ) ); ArrayList<LivingEntity> list = new ArrayList<LivingEntity>(); Predicate<? super Entity> cosa = target -> (target instanceof LivingEntity);// for (Entity target_entity : this.warudo.getEntities(this.subject, bb, cosa)) { //System.out.println(entity1.getBoundingBox()); // is the entity in the line //if (entity1 instanceof LivingEntity) { AABB aabb = target_entity.getBoundingBox().inflate(grow); //System.out.println( "x " + (aabb.maxX - entity1.getX()) + ", " + ( entity1.getX() - aabb.minX ) ); //System.out.println( "y " + (aabb.maxY - entity1.getY()) + ", " + ( entity1.getY() - aabb.minY ) ); //System.out.println( "z " + (aabb.maxZ - entity1.getZ()) + ", " + ( entity1.getZ() - aabb.minZ ) ); Optional<Vec3> optional = aabb.clip(vi, vo); //System.out.println(aabb); if (optional.isPresent()) { list.add((LivingEntity) target_entity); } } } list.sort((o1, o2) -> (Double.compare(o1.position().distanceTo(vi), o2.position().distanceTo(vi)))); return list; } 1.20.4 has not this problem anymore
  11. yaa that was // ########## ########## ########## ########## @Override public boolean onEntitySwing(ItemStack stack, LivingEntity le) { //System.out.println("onEntitySwing"); if (le != null && le.isAlive()) { Level warudo = le.level(); ItemStack main = le.getMainHandItem(); ItemStack off = le.getOffhandItem(); float swordlikebar = 0.0F; if( warudo.isClientSide() || !can_do_it(stack)){ // return false; } String world = (warudo.isClientSide())? "Mundo Local" : "Mundo Remoto"; if(le instanceof Player){ Player pe = (Player)le; swordlikebar = pe.getAttackStrengthScale(0.0F); System.out.println(world + " swordlikebar " + swordlikebar); } Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.31999996 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.31999996 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.31999996 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.71999997 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.39999998 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.39999998 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.6399999 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 0.71999997 Mundo Local swordlikebar 0.0 Mundo Remoto swordlikebar 1.0 dont works client side but i dont need that here
  12. this little sword like bar i dont know how is called i need to get the value of how much full it is i made some code to increase the horizontal range of mi melee weapons so you don't have to precisely left click on the mob but just close enough to damage it increasing the hitbox of mobs when i attack like 1.5 grow but it has a trouble mi code works regardless of the sword state so you can smacks as fast as your finger allows kinda old minecrafts style i dont want that i want it to work in synchrony whit the sword behave-our in this video i need like 3 hits to kill a zombie whit the vanilla iron sword mi steel sword does the same damage than iron but if i fast click i can damage the zombie like 8 times in the same amount of time the sword only swing like two times to fix this i want to check the state of that sword-like bar way may code only hits if the bar its over 50% or something // ########## ########## ########## ########## @Override public boolean onEntitySwing(ItemStack stack, LivingEntity le) { //System.out.println("onEntitySwing"); if( swordlikebar > 50% ) { searchAndDamageSurroundingEntities(); } return false; }
  13. i think the hitbox is moved to a side no the one minecrafts display thats good but the one your proyectile uses to detect when it hits the entitiy can you make some code to detect the entity and get the values from the hitbox i have something similar but to increase the range of melee weapons and have a similar trouble AABB aabb = target_entity.getBoundingBox().inflate(0.5F); System.out.println( this.level().isClientSide() ); System.out.println( "x " + (aabb.maxX - entity1.getX()) + ", " + ( entity1.getX() - aabb.minX ) ); System.out.println( "y " + (aabb.maxY - entity1.getY()) + ", " + ( entity1.getY() - aabb.minY ) ); System.out.println( "z " + (aabb.maxZ - entity1.getZ()) + ", " + ( entity1.getZ() - aabb.minZ ) ); Optional<Vec3> optional = aabb.clip(vi, vo); if (optional.isPresent()) { //then it hits list.add((LivingEntity) entity1); }
  14. naa a) you have to make your custom arrow entity and pass the value to the constructor way it gets internally stored in the arrow entity b) in your custome bow at moment of shooting you store the power value as nbt in the bow itemstack or capability
  15. just realize i cannot see the rain trough mi glass panels i declare the block whit the noOcclusion() flag public static final RegistryObject<Block> LIGHT_BLUE_STAINED_GLASS_PANEL = registerBlock( "light_blue_stained_glass_panel", () -> new panel_pglass(BlockBehaviour.Properties.ofFullCopy(Blocks.LIGHT_BLUE_STAINED_GLASS ).noOcclusion(), "{}", crear_archivos_glass) ); then in the model i use the flags "ambientocclusion": "true", "render_type": "translucent", soo i missing a flag or what ?
  16. Thats in blockstate.json you define the variable whit the proplerties and point to the correct model you wanna use
  17. this two methods in the entity renderer makes the entity visible in the dark but it dint light the surrounding blocks @Override protected int getBlockLightLevel(door_ghost2 ie, BlockPos pos) { return door_ghost2.fullBright ? 15 : super.getBlockLightLevel(ie, pos); } @Override protected int getSkyLightLevel(door_ghost2 ie, BlockPos pos) { return ie.level().getBrightness(LightLayer.SKY, pos); //return 15; } atomicstricker its doing something else than placing invisible non hitbox blocks coze his torch light works when you inside tall grass https://www.curseforge.com/minecraft/mc-mods/dynamic-lights
  18. i wanna animate a custome door the FallingEntityBlock thing stucks so im trying other thing now i made up a custome entity whit the shape of the door the problem is its not applying the two textures the last declared texture overwrites the former and apply it to all the faces It must look like this whit the door texture for the faces and the stripped oak for the door borders But the resulting is like this The second texture layer1 overwriting layer0 //panel_ghost_model.java //panel_ghost_renderer.java //door_ghost2.java Is this matrixstack thing was codec way it only accepts one texture ? does i misunderstand the matrixstack thing and the way of using two texture is different ?
  19. expanding the thing to test the thing a create an entity basically you right click the door block the door block generates the entity and the entity generates the falling block 1up and beging movint it to the south and little more up also every tick is rotating the fallingblock butthis dont affects visualy the entity but in code it says it does tick(){ String world = (this.warudo.isClientSide())? "Local side" : "Server side"; { FallingBlockEntity fbe = target_postate.get_FallingBlock(); //System.out.println( world + "[" + this.get_real_tick() + "], " + " ("+ target_blocks.size() +")" ); if(fbe != null){ fbe.setYRot( fbe.getYRot() + 45.5F ); System.out.println( world + "[" + this.get_real_tick() + "], " + " ("+ fbe.getYRot() +")" ); this.tick ++; } inside the code the falling block is rotating in both sides but dont doit grafically
  20. im trying to create a custom door animating it by using a falling block the falling block spawns and all is nice but i cannot manage to make it rotate some dirt code of what i have tryed so far try some know functions also some other post suggest to modified the NBT data from the falling block entitiy in code the system out shows the values changing but visually it dont's rotate the block remains still in the air #### some general advice about how to rotate a falling block entity required here
  21. yeah but dont works you put some mod.jar there an the console trow a lot of error of mixing and dont run
  22. how is not working is not loading the jsons model or is not blocking when right cliv
  23. i been google searching this they drop Material dont they ?
  24. i think the more suitable would be using the nbt format and use the ChestBlockEntity methods to get the items other could be list all the registered items make a list and get the item from the list Map<String, Item> lista_de_items = new HashMap<String, Item>(); int count = 0; for (Map.Entry<net.minecraft.resources.ResourceKey<Item>, Item> ResourceKey : ForgeRegistries.ITEMS.getEntries()) { Item actualItem = ResourceKey.getValue();//.defaultBlockState().getBlock(); String nnn = ForgeRegistries.ITEMS.getKey(actualItem).toString(); lista_de_items.put(nnn, actualItem); System.out.println( count + " [" + nnn + "]" ); count++; } Item cosa = lista_de_items.get("minecraft:apple");
×
×
  • Create New...

Important Information

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