-
Posts
34 -
Joined
-
Last visited
Converted
-
Gender
Male
-
Location
Germany
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Jonas Handtke's Achievements
Tree Puncher (2/8)
0
Reputation
-
I tried to use the Entity.setPose Method in a Keybind to force sitting the Player but it didn't work at all. Do I use it wrong? Do I need to do more than using the setPose() Method?
-
Hello Everyone, I need some help with a Method where I want to throw Exceptions on certain Conditions. If you use the Method and if any of those Conditions to throw a Exception is true, then it should give us an Exception but I don't know how to implement this right. This is the Code: public static SoulType register(String id, String displayName, SoulTypeRarities rarity, double corruption, double strength) { double minCorruption = 0; double maxCorruption = 2; double minStrength = 0; double maxStrength = 5; if (SOUL_TYPES.containsKey(id)) { throw new IllegalArgumentException("SoulType with id '" + id + "' already exists."); } if (corruption < minCorruption || corruption > maxCorruption) { throw new IllegalArgumentException("Corruption must be between " + minCorruption + " and " + maxCorruption + " ."); } if (strength < minStrength || strength > maxStrength) { throw new IllegalArgumentException("Strength must be between " + minStrength + " and " + maxStrength + " ."); } SoulType newType = new SoulType(id, displayName, rarity, corruption, strength); SOUL_TYPES.put(id, newType); return newType; }
-
I want to create a Enchantment that adds an Overlay with an Shader that acts like Echolocation Effect. Where should I start? Are this type of Shader hard to code??
-
I want to create a completely new Entity Class (exactly like the Vanilla Entity Class) but has more Properties and Fields for my Mod. For Example I want to add a new Property to add Types (Elemental, Dark, Physical, Magical etc.) this will add automatically Weakness and Strengths to the Entity. Or should I add these "Types" when an Entity is spawned?
-
EDIT: I found the Solution how to fix it by myself. I'm trying to make a Event that is fired if a Player is swimming. Here is the Event Class: public class PlayerSwimEvent extends PlayerEvent { public PlayerSwimEvent(Player player) { super(player); } } Here is the Hooks (similar to ForgeHooks Class) that has Methods for the Events: public class EventHooks { public static void onPlayerSwim(Player player) { MinecraftForge.EVENT_BUS.post(new PlayerSwimEvent(player)); } } And here is the Mixin Class: @Mixin(value = Player.class) public class MixinPlayerSwimEvent { @Inject(method = "isSwimming", at = @At("HEAD")) public boolean isSwimming(CallbackInfoReturnable<Boolean> cir) { Player player = null; if (!player.getAbilities().flying && !player.isSpectator()) { EventHooks.onPlayerSwim(player); } return cir.getReturnValue(); } } My Issue is now that I don't get it to work because of the missing Parameter Player. Can someone help with this?
-
1.20.1 ForgeRegistries.BIOMES.getKeys() returning null
Jonas Handtke replied to saxon564's topic in Modder Support
Well the Code I tried didn't work, sadly. -
1.20.1 ForgeRegistries.BIOMES.getKeys() returning null
Jonas Handtke replied to saxon564's topic in Modder Support
I think I found a found a solution but I need to check myself if this code I want to try works. -
I want to extend the Attribute Class with a new Method that if you have a specific Value of that Attribute you use this Method you get a permanent Potion Effect. For example if you have a Attribute that has the min Value 0 and the Max Value 1 and want that you get the specified Potion Effect if the Value of that Attribute is 1. I never made something like extending a certain Class with new Functionality and need some Instructions to get into. Maybe you know a good Tutorial about it.
-
I want to make a Mod similar to the Tinkers Construct Crafting System where you can use different Materials to create a Tool. But mainly I want to recreate the Texture Overlay Feature. Sadly I don't know the Method how to create something like that. Can someone tell me the rough Step how can I make something like the Tinkers Construct Crafting System?
-
Jonas Handtke changed their profile photo
-
What are the Steps to create a custom Event?
Jonas Handtke replied to Jonas Handtke's topic in Modder Support
Also does someone know which java file is calling for example the Event LivingAttackEvent? -
What are the Steps to create a custom Event?
Jonas Handtke replied to Jonas Handtke's topic in Modder Support
That was just an example and a test to see how it works.