-
Posts
1160 -
Joined
-
Days Won
7
Everything posted by poopoodice
-
[1.16.1]Game Crashes When I Shoot My Custom Arrow
poopoodice replied to Chuck16's topic in Modder Support
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). -
Show your model class.
-
[1.16.1]Game Crashes When I Shoot My Custom Arrow
poopoodice replied to Chuck16's topic in Modder Support
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. -
Players can't eat food when they are full, but you should be able to change it through the food builder.
-
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.
-
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.
-
It looked right, for me at least.
-
[1.16.1]Idea about time-dependant damage in sword?
poopoodice replied to d3us's topic in Modder Support
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. -
[1.16.1]Idea about time-dependant damage in sword?
poopoodice replied to d3us's topic in Modder Support
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. -
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.
-
-
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.
-
please post the updated problem and code
-
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.
-
[1.16.3] Player moves based on block direction
poopoodice replied to MrInfinity's topic in Modder Support
west -> negative X -Math.abs(v) -
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
-
[1.16.3] Player moves based on block direction
poopoodice replied to MrInfinity's topic in Modder Support
BlockState.get(property) -
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.
-
How do I make my block change after a period of time?
poopoodice replied to TheMajorN's topic in Modder Support
Use a tile entity or see how repeater schedule its state change -
-
Rotate block like an armorstand or banner
poopoodice replied to JoshiWorld's topic in Modder Support
You can also have a look at their blockstate jsons -
What's the updated code?