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.

Turtledove

Members
  • Joined

  • Last visited

Everything posted by Turtledove

  1. I'm trying to do different animations when the player strafes (i.e. horizontal slashes), and I don't really want to override the vanilla keybinds. In my hand render event handler, I've just done something like: if (currentposX - prevposX >= 0.1F) cancel event, and render my own, this seems to work better but again it doesn't work when the player physically can't move left or right.
  2. 1.12 isn't supported anymore, switch to 1.15
  3. I'm trying to change the way an item renders whether a player has pressed left or right on their keypad, but I'm not sure what the best way of handling this would be. In the hand's render event there isn't really a way to find out which buttons were pressed, and although I could calculate motion depending on the entity's motionZ, this fails when the player has their shoulder against a wall and can't move side to side. It also behaves strangely when the player quickly looks left or right. The best case would be to detect the keypress itself. I could register a capability to the player and set the flag when the key is input in the client, but is there a better and more direct way of doing this?
  4. What is it you're trying to do? Is it going to be an entity, item, or what? You can load jsons, objs, b3ds, or if you've got it set up in a java class, that works well too. https://mcforge.readthedocs.io/en/latest/models/files/
  5. Rule 1 of asking a question: don't get butthurt when someone points out you don't know shit, that's what you're here to supposedly solve. Rule 2, nobody is even obligated to help you, be courteous. Everything in that doc is plenty to solve your issue, registering an event handler, and subscribing to an event is less than 5 lines of code. That doc outlines what to do depending on the functionality you want, in this case Draco thoroughly explained your method must be static. So when you register your event handler, you must pass in an instance of the class, or you can annotate your class.
  6. It looks like I should be able to directly do the rendering from my event handler, but damn it's super finicky. Can't get the arm to show up on screen, but I know it's there because when I look side to side really fast I see it floating there, trailing.
  7. The issue isn't how to register items or even the rendering step, because I'm using the vanilla items so it's already registered, I'm not sure where the animation logic is done and whether I need to register a renderer for items already registered. I've written a keyframe animation API for my entities but all of that logic is done in the model class depending on model states, but for items, I don't know how Minecraft handles animation on a tick-by-tick basis for equipped items.
  8. I'm attempting to cancel the vanilla sword render when the player swings, and replace it with my own. I've subscribed to that event, cancelled it, now I just need to call a render class. What do I need to do from there in terms of registering and calling a renderer? I'm almost tempted to load in custom models and register them as entities, but I'd rather not do that if I can help it.
  9. the hand's render event seems to do what I want but I'm not really sure where to go from there. Where is the held items' rendering and attack animations done?
  10. I guess my main two questions are these: 1) If I were replacing a vanilla entity's rendering, I'd just cancel it when it spawns and render my own. It doesn't seem like I can apply anything similar to the vanilla swords. Unless I do something wonky. 2) Say I register my own item that replaces the vanilla swords and their renderers. Assuming I'm mimicking the vanilla implementation as far as held items go, how are item animations handled? I'm still in the entity renderer train of thought when it comes to model animation, where everything is done in my model class.
  11. If it's not possible to replace the animations for vanilla swords, is it just worthwhile replacing them instead? Making them unobtainable and adding my own. Although even then I"m not sure how I'd go about replacing the default holding animation, much less attacks.
  12. I would like to try to change the properties of player attacks when using a sword, both in terms of 1) the sword's animation and 2) in behavior. For example, first two hits in quick succession is a slash, and the third is a jab that knocks a mob back. I don't know where to start with the first, mods like Mo Bends doesn't have an answer for that in first person view either. Although, taking a look at Mr. Crayfish's gun mod there's an interesting solution there for first person animation. As for the second, I could maybe do something with the hurt and knockback events, where I'd cancel knockback on the first and second slash, and allow knockback on the third. But I'd also need to know the current status of the sword's cooldown timer, which I don't know how to get. Any suggestions?
  13. Probably a trivial question, but in my itemhandler I'm trying to check the item type to determine whether its valid or not for a slot. It's trivial to check the other items (whether A is instance of B or is assignable from), but it seems like the armor and shields work differently. I can't use the helper method for valid armors because the slot isn't an armor slot, it's a storage slot that can accepts any armor and shields. And of course i find it the moment after I post. Checking for the armor type works, I just wasn't checking the slot indices correctly.
  14. I've done similar for dashing side to side. I set up a tick handler where I detect if the player has pressed the movement key once, and if it's pressed again within a certain number of ticks, then execute. Use the input handler event, and send a packet to server to do the logic there.
  15. Oh yeah you're right, assuming he's registered his event handler all he'd have to do is just cancel the event. Disregard my earlier post.
  16. I would highly recommend negating fall damage with the player fall event instead, it's super easy. Send a packet to server when it triggers, and negate it there. When the event triggers, just cancel the event. I use it to negate fall damage in exchange for player mana points.
  17. Post what you've tried. But regardless, I've written a mob based off the ender dragon myself, and yes it won't do certain actions unless it meets certain conditions, which the phase manages. Without knowing what you want to do with the entity can't really help further.
  18. https://mcforge.readthedocs.io/en/1.14.x/effects/sounds/ Basically register a sound event, and have it play when players spawn in your world.
  19. Did a bit more digging and I think I found the problem, I forgot to override some of my methods.
  20. So as it turns out I wasn't actually using my itemhandler capability, I'd been calling the vanilla one, which was why it was acting weird, another silly mistake. But now that I am using it, calling windowClick causes a class cast exception with my ItemHandler. Huh.
  21. ...and more clarification on what it is that you're struggling to understand, and/or what you've tried.
  22. I've got a custom player inventory set up and good to go, I'm setting up a multi-tabbed survival inventory but am having trouble hiding certain slots depending on the tab currently clicked. So there are 3 tabs: one of them is the default survival, one of them has the crafting slots, and the other has slots for player armor, as well as slots that reference my itemhandler. Currently, if player is in tab 0, I draw the normal 3x9 player inventory slots and don't draw the crafting, custom, or armor slots, and also mask them when the mouse is interacted with. Then when they press tabs 1 or 2, the others are drawn. I've recreated the default player inventory perfectly, but when my mouse click method is called on slots that reference my custom item handler using windowClick, not the default player inventory slots, there's a class cast exception with the item handler. What are my options here? EDIT: Make sure you implement the correct classes when creating your slots for your registered item handlers, and override the correct methods.
  23. lol a different IDE isn't going to change anything, the same steps apply as in that post

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.