OutCraft
Members-
Posts
190 -
Joined
-
Last visited
Everything posted by OutCraft
-
Why closest.getX() and closest.getY()? Just pass in waypoint.getX() and waypoint.getY()
-
just renders a "Name tag" in the air. You need it with color, right?
-
Different name for Launch Files generated by gradle
OutCraft replied to Anubis's topic in Modder Support
Click on the arrow pointing down next to the launch or debug button. Then click on "Debug configurations", find the configuration for your project and change the name in the text field at the top of the config -
Ohh.. Learned something new again
-
How do you check the vanilla keybind? Just like a custom?
-
Hi! net.minecraft.client.renderer.debug.DebugRenderer has a method for rendering text in the air, it's called renderFloatingText
-
I would make a ClientTickEvent in my EventBusSubscriber and change the key to the jump key there. The keybind has a method for changing the key, pass in
-
The keybind has a method for this, doesn't it? Edit: Are you trying to modify the default value or change it back to space on change through player?
-
Ok, thanks for your help
-
Ahh, this makes sense! Can I get the goals with a clientside mod or do I need the mod on the Server and transfer packets?
-
@SubscribeEvent public void showGoal(RenderNameplateEvent event) { Entity entity = event.getEntity(); System.out.println(entity + ": " + "Hi!"); <- This triggers for all entities ((Mob) entity).goalSelector.getRunningGoals().forEach(goal -> { System.out.println(entity + ": " + "Hi!"); <- This never triggers event.setContent(new TextComponent(goal.getGoal().getClass().getName())); }); System.out.println(((Mob) entity).goalSelector.getRunningGoals().toArray().length); <- This gives length 0 }
-
The problem is that it gives me the living entity as Entity. I can cast it to Mob (I know Java, I know how to cast), but then I also can't get the goals because the Entity that I get doesn't have goals. Goals are only registered on Mobs and Entities that extend Mob
-
Hi! I want to make a debug mod. One feature of it is to show the active goals over all living entities. So I made some code in my EventHandler: @SubscribeEvent public void showGoal(RenderNameplateEvent event) { if (event.getEntity instanceof ItemEntity || event.getEntity instanceof Player) return; if (((Mob) event.getEntity())goalSelector.getRunningGoals().toArray().length <= 0) return; ((Mob) event.getEntity()).goalSelector.getRunningGoals().forEach(goal -> { //Set the name to the goal that I want }); } The problem is, that event.getEntity() returns an Entity, but for getting the goals of the entity I need a Mob (no, there isn't an event.getEntityLiving()). How would I get the entity as a Mob? Ps: I can get the world of the entity with event.getEntity().getCommandSenderWorld();
-
You can get the jump key with Minecraft.getInstance().options.keyJump.getKey()
-
I solved it: ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, () -> new ConfigGuiHandler.ConfigGuiFactory(new BiFunction<Minecraft, Screen, Screen>() { @Override public Screen apply(Minecraft mc, Screen screen) { return new MyConfigGuiScreen(); } })); (Sorry for all that needed this, I forgot to post the answer)
-
[1.18] How to register a GUI Screen for the config?
OutCraft replied to yoursred's topic in Modder Support
Hi! I needed to make the same thing and got it to work with this: ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, () -> new ConfigGuiHandler.ConfigGuiFactory(new BiFunction<Minecraft, Screen, Screen>() { @Override public Screen apply(Minecraft mc, Screen screen) { return new MyConfigGuiScreen(); })); (I don't know if this is the intended way of doing it, but for me it worked like this) -
But you can change the Keybind while the game is running What do you want to do?
-
You can make a Keybind for this. This isn't very hard. The problem is that the player can change the key for triggering the Keybind. I wouldn't make a keybind, I just wouldn't change the y value of the player motion vector (set it to playerMotionVector.y).
-
For an example look into the slab class (that all the slabs extend)
-
You need to override the method getShape or getVoxelShape or something like that in your Block class and return your own VoxelShape