Jump to content

perromercenary00

Members
  • Posts

    811
  • Joined

  • Last visited

  • Days Won

    3

perromercenary00 last won the day on February 26

perromercenary00 had the most liked content!

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

141756 profile views

perromercenary00's Achievements

Dragon Slayer

Dragon Slayer (6/8)

6

Reputation

  1. may you are talking about catching all the AGE declaration even the ones from other mods custom properties ? one would be to check only againts the minecraft BlockStateProperties class the other would be dirt your hands on the nbt data of the block and check if it have a string whit same name // ########## public String print() { BlockState blkstate = this.getBlockState(); String json = ""; //int id = Block.getId(blkstate); 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; }
  2. good days in the chicken it does areference to an entity place event triggering when chicken lays an egg if (!this.level().isClientSide && this.isAlive() && !this.isBaby() && !this.isChickenJockey() && --this.eggTime <= 0) { this.playSound(SoundEvents.CHICKEN_EGG, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F); this.spawnAtLocation(Items.EGG); this.gameEvent(GameEvent.ENTITY_PLACE); this.eggTime = this.random.nextInt(6000) + 6000; } followin the trail it takes to a GameEvent class that just register events and dont works for suscribing events internally must be register under other name i was searching the events tree on net.minecraftforge.event but no avail @SubscribeEvent public static void entityPlace(GameEvent event) { } ------- wheres the event when a chiken layes an egg ??
  3. could it be something whit the SmiffleModConfig.ENABLE_POLAR_BEAR_MEAT.get() or could be coze onLivingDeathEvent has two entities @SubscribeEvent public static void onLivingDeathEvent(LivingDeathEvent event) { Level level = event.getEntity().level(); Entity target = event.getEntity(); Entity entity = event.getSource().getEntity(); if(!level.isClientSide() && target != null && entity != null ){ System.out.println("onLivingDeathEvent(" + entity.getDisplayName().getString() + ", " + target.getDisplayName().getString() + ")"); BlockPos pos = entity.blockPosition(); Villager['Butcher'/47, l='ServerLevel[New World]', x=41.51, y=72.00, z=84.30] died, message: 'Butcher was slain by Zombie' onLivingDeathEvent(Zombie, Butcher)
  4. good days still working on the briefcases now i want to save/read inventory presets from tangible nbt files i have and old class i use to read and write nbts for structures and wanna dust out step by step goes to here return NbtIo.readCompressed(rs.get().open() );// <-- this is the error the thing is NbtIo.readCompressed now demands a second parameter from the class NbtAccounter and that seems like a kind of limiter for the nbt file size i dont get what the numbers are for is good if i just made an NbtAccounter.unlimitedHeap() and call it a day //or this piece of code gonna blowsdown something further in the way return NbtIo.readCompressed(rs.get().open(), NbtAccounter.unlimitedHeap() );// <-- this is the error can someone point me a git hub where they use this or du something similar ?
  5. if wanna do some custome blocks and items you dont need to create a parallel texture atlas you just made some json files and left that atlas part to forge to manage are you trying to do something especial ?
  6. this was the code used in older versions @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { if(!event.getPlayer().hasPlayedBefore()) { event.getPlayer().sendMessage("Hi!"); } } dont works for moddern versions what could be the equivalent in 20.4 ??
  7. Im trying to get a way to set a custome briefcase next to the player similar to the Bonus chest Digging on the code i found this two events @SubscribeEvent public static void onPlayerRespawn( PlayerEvent.PlayerRespawnEvent event) { Player pe = event.getEntity(); Level warudo = pe.level(); System.out.println("\n\n\n #### player has respawn " + ", " + warudo.isClientSide() + "\n\n\n" ); //PlayerEvent$Clone } @SubscribeEvent public static void onPlayerStarAWorld( LevelEvent.CreateSpawnPosition event) { //Player pe = event.getEntity; <--- dont exists in LevelEvent Level warudo = (Level)event.getLevel(); ServerLevelData settings = event.getSettings(); //ServerPlayer player = Minecraft.getInstance().player;<--- this crash the game PlayerEntity is null //player.position() //player.getRespawnPosition() System.out.println("\n\n\n #### onPlayerStarAWorld " + ", " + warudo.isClientSide() + ", " + "\n\n\n" ); //PlayerEvent$Clone } CreateSpawnPosition seems like he way to go but i cannot find a way extract a block position from it nor the player to then know wheres the player ################################# what i want is to get the player from this event soo i can know where it is and spawns a briefcase next to it or maybe another event that could do the same
  8. Good days I finnaly manage to fix and get a working gui from BlockItem and from BlockEntity the next issues i have to fix is this the block Entity model for some reason is moved to the south west this briefcase model must be centered but is moved to a side, i have nothing weird in the code but this is happening // ########## ########## ########## ########## @Override public RenderShape getRenderShape(BlockState blkstate) { return RenderShape.MODEL; } the block model is out of place However The hitBox of the block is right in place ########################################################################################################### This next issue Mi gui also adds the 5 slots from the player equipment the thing is theres no filter to determine whats can be put in an armor slot and what not i have this method that draws the slots for the armor, the part i dont get i slike wheres the code that responds when you set an item in a item slot to do checks and allow the item to be set or not //########## ########## ########## //Draw Player Armor private void addPlayerArmorSlots(Inventory playerInventory) { // 36 this.addSlot(new Slot(playerInventory, 39, 8, 8)); this.addSlot(new Slot(playerInventory, 38, 8, 26)); this.addSlot(new Slot(playerInventory, 37, 8, 44)); this.addSlot(new Slot(playerInventory, 36, 8, 62)); this.addSlot(new Slot(playerInventory, 40, 26, 53)); } theres must be a method that triggers when you set a itemstack inside an slot and allows to do a check if its a valid item for that slot
  9. ya i got i miss the client side thing // ########## ########## ########## @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { shield_carbon_Item.make_shield_shield( ItemInit.SHIELD_CARBON.get() ); bow_item.make_bow_bow( ItemInit.BOW_CARBON.get() ); bow_item.make_bow_bow( ItemInit.CROSSBOW_CARBON.get() ); bow_item.make_bow_bow( ItemInit.CROSSBOW01_CARBON.get() ); solution_redstone_item.make_solution_shake( ItemInit.SOLUTION_REDSTONE.get() ); briefcase_blockitem.make_briefcase_briefcase( BlockInit.BRIEFCASE_BLOCK.get().asItem() ); MenuScreens.register(MenuInit.GEM_POLISHING_MENU.get(), GemPolishingStationScreen::new); now the next part make a itemblock and open the gui from It
  10. !warudo.isClientSide() still not a gui not an error just a simple message [06:44:39] [Render thread/WARN] [minecraft/MenuScreens]: Failed to create screen for menu type: mercmod:gem_polishing_menu Not a hint of what the problem is this silent simple error dont tell much about the problem the code i made don't show errors highlighted in mi old code 1.19.4 i launch the menu part from client side but now i recheck the video and kapenjoe does it server side
  11. good days i get this error: java.lang.ClassCastException: class net.minecraft.client.player.LocalPlayer cannot be cast to class net.minecraftforge.common.extensions.IForgeServerPlayer (net.minecraft.client.player.LocalPlayer is in module minecraft@1.20.4 of loader 'TRANSFORMER' @3e8b3b79; net.minecraftforge.common.extensions.IForgeServerPlayer is in module forge@49.0.26 of loader 'TRANSFORMER' @3e8b3b79) at mercmod.blocks.classes.panel_whit_entity_inside.use(panel_whit_entity_inside.java:576) ~[main/:?] {re:classloading} at net.minecraft.world.level.block.state.BlockBehaviour$BlockStateBase.use(BlockBehaviour.java:826) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading} at net.minecraft.client.multiplayer.MultiPlayerGameMode.performUseItemOn(MultiPlayerGameMode.java:324) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.multiplayer.MultiPlayerGameMode.lambda$useItemOn$4(MultiPlayerGameMode.java:292) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.multiplayer.MultiPlayerGameMode.startPrediction(MultiPlayerGameMode.java:251) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.multiplayer.MultiPlayerGameMode.useItemOn(MultiPlayerGameMode.java:291) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.startUseItem(Minecraft.java:1799) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.handleKeybinds(Minecraft.java:2083) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.tick(Minecraft.java:1902) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runTick(Minecraft.java:1216) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:801) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:234) ~[forge-1.20.4-49.0.26_mapped_official_1.20.4-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} ------------------------------------------------------------------------------------------------------------------ context: im updating the briefcase from mi mod an i need to make a gui whit this image that gonna be launched from a block and from a item soo im using kapenjoe tutorials ---------------------------------------------------------------------------------------- The problem is that tutorial is for 1.20.1 and im using 1.20.4 and i really dont get how to call and open the gui from the block nor from the item i made this based on post i made short ago everything seems find but when right click the block to open the gui it crash the game @Override public InteractionResult use(BlockState blkstate, Level warudo, BlockPos pos, Player pe, InteractionHand hand, BlockHitResult hitresult) { if(warudo.isClientSide()){ BlockEntity blkentity = warudo.getBlockEntity(pos); if(blkentity instanceof Panel_BlockEntity){ // ↓↓↓ open the menu from the block IForgeServerPlayer ifpe = (IForgeServerPlayer)pe; //<--- this is wrong "class net.minecraft.client.player.LocalPlayer cannot be cast to class net.minecraftforge.common.extensions.IForgeServerPlayer" ifpe.openMenu( (Panel_BlockEntity) blkentity, pos ); //<-- i need an example of how open a gui in 1.20.4 } } return InteractionResult.sidedSuccess(warudo.isClientSide()); } Theres nothing highlighted in red in the code like everything where right an possible but dont works ####################################################################################################### i need to see an example, just the piece of code for the use() method of the block whit the block entity for 1.20.4 and the same but for the item @Override public @NotNull InteractionResultHolder<ItemStack> use(@NotNull Level warudo, @NotNull Player pe, @NotNull InteractionHand interactionHand) { if (!warudo.isClientSide()) { ItemStack heldItem = pe.getItemInHand(interactionHand); if (heldItem.getCapability(ForgeCapabilities.ITEM_HANDLER).isPresent()) { // ↓↓↓ open the menu from the item NetworkHooks.openScreen((ServerPlayer) pe, this); } } return super.use(warudo, pe, interactionHand); } thanks for your attention
  12. good days i have some small questions and i prefer to make only one post i wanna give the player a briefcase after creating a new world and enter for first time to it i guest that's an event for that, what it is this event? and the same but when players get killed (if possible only if killed by mobs) is an event that triggers after the player respawn ?? the recipe book the book don't shows custom item recipes until player craft them at least one time ¿ is posible to set some of mi items recipes to be visible in the book even if never crafted before ? Villager trades i wanna add some things to some villager trades in this case mi custom bow and arrow how i do that ? thanks foir your time
  13. sorry for the stuborn ness ss test code logs and planks return nothing on minable but i can use the other tags name minecraft:oak_log BlockTags.LOGS name minecraft:oak_planks BlockTags.PLANKS it kinda works but its not like like perfect
  14. 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
  15. 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 ?
×
×
  • Create New...

Important Information

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