Posted December 8, 20204 yr 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 Edited December 8, 20204 yr by Trigonaut including version of minecraft in title
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.