Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. You can either change the field type to EntityType<?> or you have to manually cast the entity type (which eventually you're gonna cast is somewhere else).
  2. Show your model class.
  3. Please always provide the crash log. You should not register anything through Vanilla Registry (see the comment above the class), use the deferred register that you already have.
  4. Players can't eat food when they are full, but you should be able to change it through the food builder.
  5. My think is since an ImageButton renders an image on it, if it renders text as well it will become really messy (mixture of text and image). For every widget to have a message/title is probably for voice narrating? I'm not so sure about this.
  6. Please provide the crash log, and you should probably get the block colours from the event instead of minecraft instance.
  7. The constructor of both of the button you are using passes Button.field_238486_s_ (empty), whereas there won't be any hovered text/tooltip being displayed, so I assume you are talking about the text that is rendered on the button: ImageButton overrides renderButton and does not call super.renderButton(...) (but Button did), and in Widged#renderButton it draws the title you passed in, therefore ImageButton does not render the title, but Button does.
  8. It looked right, for me at least.
  9. LivingHurtEvent only triggers when a living is being attacked, where you can recalculate the corresponding damage when the attacker is holding your sword. If you want to change sword texture based on the time, check out ItemModelProperties, the provider has world as one of its parameter which you can also apply the game time logic there as well.
  10. You can use LivingHurtEvent and check if the attacker (DamageSource#getTrueSource, it can be null) is holding the sword, then modify the damage according to the time (World#getDayTime or something) there. Or you can override Item#getAttributeModifers and apply the calculations there.
  11. What's the condition of changing the texts? If it's your own screen I think Screen#tick might be what are you looking for.
  12. You can't such things on client (spawning entities), you need a packet to process the action on server. So does block adding/removing, you need to do that on server, also don't use numerical id to get blocks, items..etc. You can check how vanilla egg, snowball like items creates projectile entities when right clicked.
  13. please post the updated problem and code
  14. I had a briefly look so I might be wrong: This event is also triggered on server side in ServerPlayNetHandler L957, when received action StartDestroyBlock/AbortDestroyBlock/StopDestroyBlock, and I think that is the reason you had the even triggered once again when player release the mouse (aborts/stops block breaking), but I can not confirm that, you may want to test and see which part has trigger the event.
  15. west -> negative X -Math.abs(v)
  16. This statement in ItemModelProperties decides whether the player is pulling the bow (what I meant was you can have a look at the class to get an idea of how it does it, instead of directly use the methods in that place), which was one of the thing you were looking for. You should not compare the items like this, this is not how you compare strings either (it will never be true, use Object#equals). Since items in vanilla are singletons, you can use == to compare them, for example stack.getItem() == Items.BOW isHandActive() checks if the player is using something like eating, drinking...etc
  17. May not be the problem but are you clearing the data and mark it dirty in the constructor?
  18. BlockState.get(property)
  19. If the official documentation has the whole explanation of every methods, classes, fields... etc, the time taken to update it will be long enough for Vanilla to release another version. If you don't think the doc contains enough information, you can always make new pr and improve it. PlayerTickEvent is a type of TickEvent which it is triggered twice a tick, TickEvent.Phase.Start/End, you should check for one of them. For the swingProgress because it is triggered once a tick so it take away 80 instead of 40 For the bow you can check if player's holding the bow and if the hand is active, see how ItemModelProperties decides "pulling" property for bows.
  20. That's not the error that is preventing you from joining the server.
  21. Use a tile entity or see how repeater schedule its state change
  22. You can also have a look at their blockstate jsons
  23. What's the updated code?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.