Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Zacomat

Members
  • Joined

  • Last visited

  1. On Forge 58.0.5 (MC 1.21.8), InputEvent.MouseScrollingEvent is marked cancellable (implements Cancellable, uses a CancellableEventBus), but the event type does not expose setCanceled(boolean) or cancel() from a @SubscribeEvent listener. What’s the correct way to cancel this event (or otherwise block vanilla scroll behavior) from mod code? Can someone plz point me in the right direction? Thx
  2. 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!
  3. 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!
  4. 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
  5. 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.
  6. 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 } }
  7. Do I need to create a dummy ServerPlayer? This is what I tried, but without success... Or is there some other way?
  8. 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"); }
  9. Your textures path should be for example resources/assets/firstmod/textures/item/plutonium.png and your mod id must be firstmod
  10. 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));
  11. 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
  12. I was referring to version 1.20.1. I apologize for mentioning the wrong version.
  13. 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
  14. 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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.