- [SOLVED][1.21.8 | Forge 58.0.5] How to cancel InputEvent.MouseScrollingEvent?
-
[SOLVED][1.21.8 | Forge 58.0.5] How to cancel InputEvent.MouseScrollingEvent?
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
-
-
1.20.4 BaseEntityBlock codec method
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!
-
obfuscated names to use in file accesstransformer.cfg
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!
-
[1.21] porting render gui overlay mod from 1.20.2
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
-
[Solved][ 1.20.1] How to make mobs open chests?
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.
-
biome_modifier: forge:add_spawns
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 } }
-
[Solved][ 1.20.1] How to make mobs open chests?
Do I need to create a dummy ServerPlayer? This is what I tried, but without success... Or is there some other way?
-
in 1.20 how would I make a right click detector for a specific item
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"); }
-
Textures not loading properly
Your textures path should be for example resources/assets/firstmod/textures/item/plutonium.png and your mod id must be firstmod
-
How would I select an area to deal damge in
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));
-
Renaming output file
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
-
Custom Flower Block Have Black Background
I was referring to version 1.20.1. I apologize for mentioning the wrong version.
-
1.20 I need help with making a right click detector that detects when you right click while holding a specific sword
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
-
Help I crash everytime I hit a mob
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.
IPS spam blocked by CleanTalk.