Jump to content

Zacomat

Members
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    1

Zacomat last won the day on July 20 2023

Zacomat had the most liked content!

Converted

  • Gender
    Male
  • URL
    http://www.patreon.com/user?u=4995675
  • Personal Text
    I am new!

Recent Profile Visitors

130439 profile views

Zacomat's Achievements

Stone Miner

Stone Miner (3/8)

3

Reputation

  1. In Minecraft version 1.20.4, using Forge 49.1.0, the BaseEntityBlock class has an abstract method protected abstract MapCodec<? extends BaseEntityBlock> codec();. Can someone please explain how to implement this method? Returning null doesn't seem to cause crashes... Thanks!
  2. Hi all! I want to find the obfuscated names for various fields in recent versions of Minecraft (greater than 1.20.2). Can someone please tell me where to search? Thanks very much!
  3. I am trying to port my mod from 1.20.2 to 1.21, but I am encountering difficulties regarding the classes for rendering the GUI and related events. What are the equivalents of the following classes? net.minecraftforge.client.event.RenderGuiOverlayEvent net.minecraftforge.client.gui.overlay.NamedGuiOverlay net.minecraftforge.client.gui.overlay.ForgeGui net.minecraftforge.client.gui.overlay.GuiOverlayManager net.minecraftforge.client.gui.overlay.IGuiOverlay thx
  4. I think that simply sending a message from the server to all clients when a chest is opening or closing would be sufficient. There no difference if player opening the chest is not the ClientPlayer. The problem is that every implementation of BaseContainerBlockEntity handles the opening and closing in its own way. So, I created the interface BaseContainerBlockEntityWrapper and its specific implementations: BarrelBlockEntityWrapper ChestBlockEntityWrapper ShulkerBoxBlockEntityWrapper DefaultBaseContainerBlockEntityWrapper In each of these implementations, I wrote specific code to handle the wrapped instance.
  5. Could someone please explain the 'weight' parameter in the 'biome_modifier/my_mob.json' file? Based on my experiments, I've observed the following: Weight 5: Very rare Weight 10: Rare Weight 15: Uncommon Weight 20: Common Weight 25: Very common These results were obtained from exploration in caves and on the surface using the following file: { "type": "forge:add_spawns", "biomes": "#minecraft:is_overworld", "spawners": { "type": "exmplemod:my_mob", "weight":15, "minCount": 1, "maxCount": 1 } }
  6. Do I need to create a dummy ServerPlayer? This is what I tried, but without success... Or is there some other way?
  7. if you have a class for your sword that extends SwordItem just override the methos use: @Override public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) { System.err.println("use hand=" + hand); return super.use(level, player, hand); } else you can use events in MinecraftForge.EVENT_BUS: @SubscribeEvent public void onLivingEntityUseItemEventStart(RightClickItem event) { System.err.println("RightClickItem"); } @SubscribeEvent public void onLivingEntityUseItemEventFinish(RightClickBlock event) { System.err.println("RightClickBlock"); } @SubscribeEvent public void onLivingEntityUseItemEventStop(EntityInteract event) { System.err.println("EntityInteract"); } @SubscribeEvent public void onLivingEntityUseItemEventTick(EntityInteractSpecific event) { System.err.println("EntityInteractSpecific"); }
  8. Your textures path should be for example resources/assets/firstmod/textures/item/plutonium.png and your mod id must be firstmod
  9. I think this should work: ServerPlayer player = ...; double radius = 8; List<LivingEntity> list = player.level().getEntitiesOfClass(LivingEntity.class, player.getBoundingBox().inflate(radius,radius,radius), e->(/*filter entities and return true if accetted*/true));
  10. I all! I want to rename my output file that is "examplemod-1.0.0.jar" to a new filename containing mc version: "examplemod-1.20.1-1.0.0.jar" What i have done is to copy the output file to a new file with new filename and then delete the old file. This works but i'd like to know what is the correct way to do it. this is my code: tasks.named('build') { doLast { def orig_file = "${buildDir}/libs/${mod_id}-${mod_version}.jar" println "orig_file: ${orig_file}" def source_file = "${buildDir}/libs/${mod_id}-${minecraft_version}-${mod_version}.jar" println "source_file: ${source_file}" copy { from "${orig_file}" into "${buildDir}/libs" rename "${mod_id}-${mod_version}.jar", "${mod_id}-${minecraft_version}-${mod_version}.jar" } delete "${orig_file}" def dest_client_dir = "$projectDir/../client-${minecraft_version}-${forge_version}/mods/" println "dest_client_dir: ${dest_client_dir}" def dest_server_dir = "$projectDir/../server-${minecraft_version}-${forge_version}/mods/" println "dest_server_dir: ${dest_server_dir}" copy { from "${source_file}" into "${dest_client_dir}" } if("${displayTestLine}"!="displayTest=\"IGNORE_ALL_VERSION\"") copy { from "${source_file}" into "${dest_server_dir}" } } } thx
  11. I was referring to version 1.20.1. I apologize for mentioning the wrong version.
  12. if you have a sword class you should override the method use(Level p_41432_, Player p_41433_, InteractionHand hand) that is called when you hold use key (right mouse button). Or else you can subscribe to PlayerInteractEvent subclasses: EntityInteractSpecific EntityInteract RightClickBlock RightClickItem
  13. It seems that in TravelersBackpack-1.19.2-8.2.30.jar mod they forgot to register travelersbackpack:bee. Remove this mod or change version and try again.
  14. For example during the PlayerLoggedInEvent ServerPlayer p= (ServerPlayer)event.getEntity(); p.connection.getRemoteAddress(); this will return an InetSocketAddress if the client is remote
  15. the json is error free but do you have the line "render_type": "cutout" in your model class?
×
×
  • Create New...

Important Information

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