Jump to content

perromercenary00

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. i have this custome crossbow i made it autoloads after the first shoot is nice and all but i don't like how when aiming it begins missaligned a little to the right then it slowly trembles a few and aligning whit the crosshair this is coze the bow animation id vertical and made this crosbow rotate 90degrees public UseAnim getUseAnimation(ItemStack p_40678_) { return UseAnim.BOW; } why i dont use UseAnim.CROSSBOW for a crossbow you see the vainilla crossbow from the CrossbowItem.class uses a tag to know if its pulling to load an arrow or to shoot private static final String TAG_CHARGED = "Charged"; i copy this methods to mi crossbow and set to UseAnim.CROSSBOW but dont seems to do nothing public static boolean isCharged(ItemStack p_40933_) { CompoundTag compoundtag = p_40933_.getTag(); return compoundtag != null && compoundtag.getBoolean("Charged"); } public static void setCharged(ItemStack p_40885_, boolean p_40886_) { CompoundTag compoundtag = p_40885_.getOrCreateTag(); compoundtag.putBoolean("Charged", p_40886_); } inside LivingEntity.class there is this .getUseItemRemainingTicks() thats used to calculate the bow pulling but seems like theres no .setUseItemRemainingTicks() hoping to be understandable i need to override the way the pulling animation is calculated to set it to the max from the beginning just for the sake of aesthetics
  2. is usual than the imported classes changes in name and int path from version to version are you sure the code you are putting is for the version you are trying to run
  3. i guest is the word "models/" in the json pathname abrasmagics:models/item/ingot_test.json { "parent": "mercmod:item/parent/ingots/parent_ingot_model", "textures": { "layer0": "mercmod:item/surface/acero-clear", "particle": "mercmod:item/surface/acero-clear" } }
  4. you cannot sent chat message to server coze you cannot display messages in the server side thats a client only thing if you wanna make something happend server side from a client side trigger then https://www.youtube.com/results?search_query=kaupenjoe+networking
  5. yes you are right """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""" i have this problem but left it behind coze many other thing to do Mi plan was to sync the local word arrow position just the first tick using the EntityDataAccessor and let it go from there private static final EntityDataAccessor<Vector3f> VI = SynchedEntityData.defineId(lance_entity.class, EntityDataSerializers.VECTOR3); // #################### #################### #################### @Override protected void defineSynchedData() { this.entityData.define(VI, new Vector3f(0f,0f,0f) ); } @Override public void tick() { //do some code to update the posicion just one time this.entityData.set(VI, this.position() ); if( vi is not [0,0,0] ) this.setPos( this.entityData.get(VI) ); when you make it work lend me your code
  6. nothing replace it you have to use the minecraft block tags or made your own lists of blocks if (dblkstate.canBeReplaced()) { System.out.println("blkstate.canBeReplaced()"); } if (dblkstate.is(BlockTags.MINEABLE_WITH_AXE)) { System.out.println("BlockTags.MINEABLE_WITH_AXE"); } if (dblkstate.is(BlockTags.MINEABLE_WITH_PICKAXE)) { System.out.println("BlockTags.MINEABLE_WITH_PICKAXE"); } if (dblkstate.is(BlockTags.MINEABLE_WITH_SHOVEL)) { System.out.println("BlockTags.MINEABLE_WITH_SHOVEL"); } if (dblkstate.is(BlockTags.LOGS)) { System.out.println("BlockTags.LOGS"); } if (dblkstate.is(BlockTags.PLANKS)) { System.out.println("BlockTags.PLANKS"); }
  7. that means writing yourself the code
  8. im just coping the properties from the glass block whit no occlusion and the "render_type": "translucent", public static final RegistryObject<Block> GLASS_PANEL = registerBlock( "glass_panel", () -> new panel_pglass(BlockBehaviour.Properties.ofFullCopy(Blocks.GLASS_PANE).noOcclusion(), """ { "name":"glass_panel", "en_us_lang" : "Glass Panel", "es_es_lang" : "Panel De Vidrio", "north": "minecraft:block/glass", "crafthing_input_c0": "minecraft:glass", "cutthing_input_c0": "minecraft:glass", "no_drop" : "true" } """, crear_archivos_glass ) ); { "credit": "Made with Blockbench", "ambientocclusion": "true", "render_type": "translucent", "elements": [ { "name": "panel", "from": [0, 0, 0], "to": [16, 16, 4], "faces": { "north": {"uv": [0, 0, 16, 16], "texture": "#north"}, "east": {"uv": [12, 0, 16, 16], "texture": "#east"}, "south": {"uv": [16, 0, 0, 16], "texture": "#south"}, "west": {"uv": [0, 0, 4, 16], "texture": "#west"}, "up": {"uv": [16, 16, 0, 12], "texture": "#up"}, "down": {"uv": [16, 4, 0, 0], "texture": "#down"} } } ], the thing whit this that rain and snow cannot be see trough the block
  9. you need a damage source and use it to hurt the entity thing DamageSource damagesource; //damagesource = level.damageSources().playerAttack((Player) le);//.trident(le, thing); damagesource = level.damageSources().mobAttack(player); if (thing.hurt(damagesource, damage)) { thing.setLastHurtMob(player); }
  10. Hellow good days i have a custome block dead adventurer shaped i use to spawn mobs but the mobs i spawn has no equipment zombies without nothing and skeletons without bows minecraft has a series of json files organizing items and block by categories then there is the minecraft:data/minecraft/tags/items/swords.json { "values": [ "minecraft:diamond_sword", "minecraft:stone_sword", "minecraft:golden_sword", "minecraft:netherite_sword", "minecraft:wooden_sword", "minecraft:iron_sword" ] } and i got mi own json file with the mines /home/usuario/workspace/1.20.4/mercmod/src/main/resources/data/minecraft/tags/items/swords.json { "values": [ "minecraft:stick", "mercmod:knife_steel", "mercmod:sword_steel", "mercmod:warhammer_steel", "mercmod:battleaxe_steel", "mercmod:crowbar", "mercmod:lance_steel" ] } ############################ i wanna use this files, read them, randomly select one and set it for the mob mainhand i spawning i wanna do something like ArrayList<String> list = ItemTags.SWORDS.something_getKeys(); data/minecraft/tags/items/arrows.json data/minecraft/tags/items/axes.json data/minecraft/tags/items/hoes.json data/minecraft/tags/items/pickaxes.json data/minecraft/tags/items/shovels.json data/minecraft/tags/items/swords.json
  11. the world capability works for the current world and its different for every dimension sound like what you need the only thing is you cannot access data from a diferent world things like reading a data of the overworld from the nether would nwork
  12. use inventorytick() whit the slot number you can know if its into an armour slot //########## ########## ########## public void inventoryTick(ItemStack helditem, Level warudo, Entity en, int slot, boolean value) { Long wtick = 0L; int tick = 0; // System.out.println("\n#inventoryTick#\n"); if( !warudo.isClientSide ){ wtick = warudo.dayTime(); if( wtick % 20 == 0 && en instanceof Player ) { item_handler ih = get_itemhandler(helditem); //inicializar tiempo if (ih.start_time < 1L) { ih.start_time = wtick; } ih.time = (int) ( wtick - ih.start_time ); tick = ih.time; //cada 5 seg causar daño por fuego al player if (tick > 0 && tick % 100 == 0) { en.setSecondsOnFire(1); } //despues de un minuto el lingote se enfria y vielve a ser hierro if ( tick > 1200 ) { // helditem = new ItemStack( Items.IRON_INGOT, helditem.getCount() ); ((Player) en).getInventory().setItem(slot, helditem ); } } } }
  13. i have not test it but you must extend the slot class overriding the max stack size to 1 public int getMaxStackSize() { return this.container.getMaxStackSize(); } then in the menu class use your custome slot class to declare the slot this.addSlot(new SlotItemHandler(handler00, 6, 62, 35));//slot zero this.addSlot(new ArmourSlotItemHandler(handler00, null,5, 80, 8));//head
  14. Good days im working on this Costume underground dungeon the plan is creating a mineshaft tunel whit fully functional railway and rail switchs going deep down into the ground My hypothesis its than than the rails get created before the supporting stone blocks i was setting blocks whit Level.setBlock(pos,blkstate,2) in mode 2 i change it to 10 but the problem persist in the doorblock class it uses 3 as flag level.setBlock(p_52750_.above(), p_52751_.setValue(HALF, DoubleBlockHalf.UPPER), 3); i set 3 as flag the problem continues (i du not know what 3 means) this numbers are basically a mistery ===> i need the number mode to set a block into the world whithout doing any checks or triggering neighbors blocks ############# The nbt class has an Enum to make more redable the code is in "import net.minecraft.nbt.Tag;" nbtpos = entitydata.getList("blockPos", Tag.TAG_INT);// blockdata contains pos; if theres something like this for the setBlockMode that would be nice
  15. this is a really old resurrected post anyway //values to nbt ListTag nbtblockpos = new ListTag(); nbtblockpos.add(IntTag.valueOf(blockPos.getX())); nbtblockpos.add(IntTag.valueOf(blockPos.getY())); nbtblockpos.add(IntTag.valueOf(blockPos.getZ())); entitydata.put("blockPos", nbtblockpos); ListTag nbtpos = new ListTag(); nbtpos.add(DoubleTag.valueOf(Pos.x)); nbtpos.add(DoubleTag.valueOf(Pos.y)); nbtpos.add(DoubleTag.valueOf(Pos.z)); entitydata.put("pos", nbtpos); //getting things back if(entitydata.contains("blockPos")) { nbtpos = entitydata.getList("blockPos", Tag.TAG_INT);// blockdata contains pos this.blockPos = new BlockPos( nbtpos.getInt(0), nbtpos.getInt(1), nbtpos.getInt(2) ); } this.pos = null; if(entitydata.contains("pos")) { nbtpos = entitydata.getList("pos", Tag.TAG_DOUBLE);// blockdata contains pos this.Pos = new Vec3( nbtpos.getDouble(0), nbtpos.getDouble(1), nbtpos.getDouble(2) ); }
  16. not a bug when you declaring the block BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_WOOD) the one you are copyng from has different set of properties seems it has horizontal facing but the yours don't
  17. im doing a kin of custome mineshaft tunel but whit slabs notice minecarts dont works out of minecar rails soo i need to find a way to lay rails on slabs having in account inclination Here in the video the minecart stucks on the slab it can not run over anything different from rail blocks i was thinking into extending RailBlock but latter how i make minecrats to aknoledge mi custome rail slab or vainilla rails to connect whit the costume one or it is anothe option besides making a custome mine cart and override the vainilla one ??
  18. broo i dont know what are you doing but i think that thing is lacking parentheses Level waruddo = pe.level()
  19. weirdly as it looks today works as it must be i could think anything else than some kind of problem whit mi intelligi work environment
  20. Brooo you are in 1.12 why do you made mods on 1.12 in 2024 anyway i have similar issue in 1.20.4 in mi case to fix i have to make the BlockEntity to manually call on blockEntityChanged() to inform the world the block entity has change and need to be saved // ########## ########## ########## ########## @Override protected void saveAdditional( CompoundTag nbt ){ //System.out.println("\n##saveAdditional(), " + this.getBlockPos() ); nbt.put("inventory", itemhandler.serializeNBT() ); nbt.putInt("progress", this.progress ); super.saveAdditional( nbt ); //System.out.println(NbtUtils.prettyPrint(nbt)); this.getLevel().blockEntityChanged(this.getBlockPos()); //<---------- } but this is in 1.20.4 may theres something equivalent in 1.12
  21. i have mi own custome class to spawn structures and notice it was doing weird things debuggin the thing i find this piece of code was not picking mi blocks this piece of code is suposed to create two lists way its easier to get a block habing only the name or the oposite to extract the name from a block have like 800 blocks of mi own this code is just picking like random 60's dont know if is a bug or this definitively change coze in 1.19this works great ################# well i need a new way to make a list of all the loaded blocks whit names for 1.20.4 thanks for your readings
  22. i recheck the kapenjoe tutorial from another stance and actually manage to make custom trades for the villagers and the trader seems like the wanderer has 64 normal trades and 6 especial ### addCustomWandererTrades( generic 64) ### addCustomWandererTrades( rare 6) ################################################## the problem is that the 3 custome trades i add rarely gets loaded in the wanderer offered item list but are there if i delete the list whit generic.clear() before adding mi things then only mi things get loaded an a ice cube i dont know where is coming generic.add((trader, rand) -> new MerchantOffer( new ItemStack(Items.EMERALD, 6), new ItemStack(BlockInit.POTTED_BLUE_HERB.get().asItem(), 2), 2, 10, 0.02F) ); it dont seems to be a weight variable to increase the possibility of mi custom trades ######################### what i want is to increase the chance of mi custome trades to be vissible how can i do that....
  23. This is a costume block whit the shape of a zombie is not a full block its flamable when ignited the flames just burn on top or by a aside that dint seems right // ########## ########## ########## ########## @Override public int getFlammability(BlockState state, BlockGetter level, BlockPos pos, Direction direction) { return 300;//((FireBlock)Blocks.FIRE).getBurnOdds(state); //300 } it just seems like check to know if a fire block could despawn mi block ########### i want mi block to look more like this what could i use i was thinking on something like onNeigbourgChange() check for nearby fire or lava blocks then using the falling block entity spawn a fire block in the same position than mi dead body block thanks for your readings
  24. thast right kapenjoe says something about not going up from 1.20.2 for some package issue i have the mine working messing around until the code start working still seems like you have some more complex than the mine //in mi main class //########## ########## ########## ########## ########## ########## ########## ########## private void commonSetup(final FMLCommonSetupEvent event) { ModMessage.register(); } ModMessage.class
  25. i has that anyway i test it at the beginning and the end of the function just to be sure @Override public void load( CompoundTag nbt ){ super.load( nbt ); Level warudo = this.getLevel(); itemhandler.deserializeNBT( nbt.getCompound("itemhandler") ); this.progress = nbt.getInt("progress" ); System.out.println("load(nbt)"); System.out.println(NbtUtils.prettyPrint(nbt)); //super.load( nbt ); } but it does the same looking at it a second time it seems like it only store the nbt data when the entity is created and set into the world then never update values
×
×
  • Create New...

Important Information

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