
Trigonaut
Members-
Content Count
3 -
Joined
-
Last visited
Community Reputation
0 NeutralAbout Trigonaut
-
Rank
Tree Puncher
-
I am trying to change the way damage to the player is affected by the game's difficulty. At the beginning of the vanilla PlayerEntity.attackEntityFrom() method (where these calculations are normally applied), there is a Forge hook for a LivingAttackEvent, but it doesn't seem offer any way to change the damage being dealt by that attack. I could probably accomplish what I'm looking for by copying all of the code from PlayerEntity.attackEntityFrom() and LivingEntity.attackEntityFrom(). into my subscribed method, but there must be a better way. How best can I override/bypass the formulas for when a player is damaged at different difficulties?
-
I am trying to add a new type of shield, but its json model does not seem to respect the 'blocking' predicate even though the item extends ShieldItem. How should I make the blocking predicate set to 1 when the shield is used, like the vanilla shield?
-
I am trying to create an entity which mimics the player using an item (placing a block, using a bucket, etc.). I have a class VirtualPlayerEntity extends PlayerEntity, which is passed into the onItemRightClick method for the item my entity is holding. My problem arises when that item is an empty bucket, used on a fluid block. In the onItemRightClick method for the BucketItem class I get the error: <com.trigonaut.mod.entity.VirtualPlayerEntity cannot be cast to net.minecraft.entity.player.ServerPlayerEntity> caused by the FILLED_BUCKET criteria trigger. How do I make VirtualPlayerEntity able to cast to ServerPlayerEntity? (preferably without extending it) Is there a better way to emulate a player right-click? How do other mods create this functionality? Attached is my VirtualPlayerEntity class. VirtualPlayerEntity.java