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.

BliX5

Members
  • Joined

  • Last visited

Everything posted by BliX5

  1. I've moved the ClickInputEvent to my client events and I've fixed the values. The problem now is that the method onClickEvent is running before onPlayerHit, which delays whether the hit is cancelled or not for the next left click, despite how I set the events' priority in my main class.
  2. I tried to fix more of the code, and I got it to work most of the time, but it's still incredibly buggy. ModServerEvents: @Mod.EventBusSubscriber(modid = BotwMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class ModServerEvents { public static float a; @SubscribeEvent public static void onPlayerHit(final AttackEntityEvent event) { ModServerEvents.a = event.getPlayer().getCooledAttackStrength(0); BotwMod.LOGGER.debug(String.valueOf(ModServerEvents.a) + " onPlayerHit"); if(ModServerEvents.a < 1) { event.setCanceled(true); } } @SubscribeEvent public static void onClickEvent(final InputEvent.ClickInputEvent event) { BotwMod.LOGGER.debug(String.valueOf(ModServerEvents.a) + " onClickEvent"); if(ModServerEvents.a < 1) { event.setCanceled(true); } ModServerEvents.a = 1; } } Main Class: MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGHEST, ModServerEvents::onPlayerHit); MinecraftForge.EVENT_BUS.addListener(EventPriority.HIGH, ModServerEvents::onClickEvent);
  3. I tried it, but it doesn't work about half of the time. Is there a way to add some sort of delay between the events so the a value is recorded before onClickEvent is put into action? public static float a = 1; @SubscribeEvent public static void onPlayerHit(final AttackEntityEvent event) { ModClientEvents.a = event.getPlayer().getCooledAttackStrength(0); if(ModClientEvents.a < 1) { event.setCanceled(true); ModClientEvents.a = 1; } } @SubscribeEvent public static void onClickEvent(final InputEvent.ClickInputEvent event) { if(ModClientEvents.a < 1) { event.setCanceled(true); ModClientEvents.a = 1; } }
  4. Here's my code so far: @SubscribeEvent public static void onPlayerHit(final AttackEntityEvent event) { if(event.getPlayer().getCooledAttackStrength(0) < 1.0F) { event.setCanceled(true); } } I want to make it so while on cooldown, the player cannot hit at all. With this code, the player can still hit, but it doesn't do damage to entities. Is there any other event I can use to cancel the left click entirely?
  5. I’ve made an event so the player can’t damage entities during an attack cooldown, but whenever the player hits during a cooldown, it resets. How can I stop this from happening and make it so the player can’t punch at all?
  6. How do I make it so my custom entity has an emissive texture? I couldn't find any tutorials on it specifically for modding, only for making resource packs, so I'm kinda confused on how it would work in a mod and whether it would require Optifine or not.
  7. I know this topic is kinda dead, but I wanted to bring a different way to implement this mod. I'm removing all of my ideas before as well. Each W value can be a dimension, and this may sound extremely CPU-intensive, but there is a solution. 60,000,000 total dimensions is possible. Granted, the player won't be going through every single dimension, just as the player doesn't go through every single Minecraft chunk. The game doesn't register every dimension on startup, but it generates these dimensions like chunks. Take Minecraft's April Fools snapshot from this year. You can write anything in a book and chuck it into a portal, and as soon as you jump through, it generates a completely random dimension. If I could come up with some method to make a 3D biome map and I just made every generated dimension a new overworld, this could be possible, of course with some major tweaks to structures and mob AIs. The gameplay will act similar to Miegakure's, so instead of clicking two buttons to move left and right across the W axis, there are two buttons to rotate left and right, or rather, ana and kata. I'm still deciding whether I should make the rotation a full 360 degrees or just 4 selections of rotation: XYZ, WYZ, XWZ, and XYW. A 360 degree rotation function would have a mix of all the values depending on how long the player holds each button for. While I don't entirely know how the splicing of dimensions will be done, I'm sure there's some way to do this. While this idea is most likely nearly impossible for Forge, I'm not dropping the concept just yet. I've been working with datapacks recently, and since dimensions are written in json now, most of these concepts will be performed via a datapack. For now, the rendering is the least of my worries. I'm not giving up on this concept, and I'm not dropping any of these ideas unless anyone has any better method, which is likely the case.
  8. Here's my dumb rotation diagram idea: I don't know how long this thing will take me and I don't even think I'll finish it. If it requires a good PC, then that's fine because the mod is just for me and my friends anyways. I'll just do some research on displaying a value on the F3 screen
  9. Since it's 4D projected into 3D, the entire area of generation won't be projected at once, so the load will maybe be more than twice, but not as much as you would think. I didn't say, making the mod would take a few weeks. It could take a year. All I'm saying is Miegakure was a useful resource in making the mod concept. Also, a lot of the time making Miegakure was probably spent on the levels and their 4D counterparts, especially since everything is those levels were made from scratch, while Minecraft should do it instantly. Also, in Miegakure, objects aren't blocks, they're 3d models. Blocks are a lot easier to work with when switching between 4 dimensions because (with enough time) you could possibly make some algorithm that finds different planes around a changing block to deform accordingly. As for the rotation, I have an idea to have all of the axes visible, as well as the W, but that's not important right now. I'm not sure if this is possible, which is one of the reasons I asked this question here in the first place.
  10. If you don't understand the post above, that makes sense because I suck at explaining things. I just wanted to know if there was some way to add a W axis to the world, or at least in the F3 screen.
  11. I don't think you understand. The computer doesn't run all 60 million dimensions at once, just like how a computer doesn't run all 60 million by 60 million blocks in the world at once. It will use the seed and each 60 million W values to generate new terrain in a certain distance from the player, which will probably be 10 chunks. There will definitely be a performance drop, but nothing too severe, maybe only twice the load. Also, what I'm making is not normal Minecraft dimensions. It's naturally generating the same world multiple times except with one more variable when generating, which will create a W axis with 60 million blocks. There will be two keys to press on the keyboard to move left and right across this axis, and as you do so, the world will deform just slightly. Rivers may change shape; mountains and valleys may shrink or grow; and forests, lakes, oceans, vegetation, and biomes may also do the same, therefore becoming 3D instead of 2D including the W axis. Structures will get larger and smaller as well depending on your W axis. Try researching into a 4th dimension concept to understand it better. This video perfectly describes it, except that game is in a small, enclosed space, while Minecraft is much larger. ?
  12. I'm not making a mod between the normal Minecraft dimensions, but the mod will generate 60 million different alternate versions of your normal world, with many things slightly different, which is why I need a W value. It's kind of complex
  13. I'm developing a Minecraft 4th dimension concept mod, so I'm starting by adding a W value (trength) that the game can take into account when generating and rendering blocks, or at least make it show up on the F3 screen. I just wanted to know if this was possible, and where I should even start to look into how I could implement this in my mod.
  14. I've looked into the HoglinEntity and HoglinTasks java files, but I couldn't find anything specifying warped fungus. It could be located in a different file, but I'm not entirely sure. For now, I'll just stick with making my own goal.
  15. I copied the file into my own ai goal directory, but I don't know how to change the target to a block. I tried extending T to Block and Blocks, but I wouldn't really know which terms invoke an entity.
  16. I can't seem to find a goal in registerGoals that makes an entity run away from a block, and I don't think any mob in the game does, so I couldn't find an example. Any help would be appreciated.
  17. Thanks, it works now, for the most part. There's still the fire animation in the night though, but it isn't actually taking damage.
  18. I made a LOGGER line, and it keeps reporting as 0, even though there is a torch right next to it.
  19. I have some code, but it doesn't seem to work: public void livingTick() { if (this.isAlive()) { boolean flag = (this.shouldBurnInDay() && this.isInDaylight()) || this.isInLightLevel(); if (flag) { this.setFire(4); } } super.livingTick(); } protected boolean isInLightLevel() { return world.getLightValue(this.getPosition()) >= 8; } Any help?
  20. I'm trying to make an entity burn in a certain light level, but I don't know how to get it. Any help would be appreciated.
  21. Nevermind, I had a different name specified in my arguments, so for me it was just state.get(). All works find now, thanks for the help.
  22. .get doesn't seem to work for me.
  23. How would I get a value from the blockstate itself?
  24. The if statement won't let me compare a BooleanProperty to a Boolean because apparently they're two separate things, and I have no idea how to fix this.
  25. Adding onto it, is there any way I can change it so you can only toggle it once?

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.