Posted May 3, 20205 yr Hi, i'm trying to spawn my custom dolphine when i right-click a dolphin, in order to do this when the event fires i remove the vanilla dolphin, instantiate my own and make player ride it. Here is the code: @SubscribeEvent public static void onDolphinInteract(PlayerInteractEvent.EntityInteract e) { if(e.getTarget() instanceof DolphinEntity && e.getTarget() != null) { World worldIn = e.getWorld(); DolphinEntity dolphinEntity = (DolphinEntity) e.getTarget(); ClientPlayerEntity player = Minecraft.getInstance().player; if(player != null && player.getRidingEntity() == null) { dolphinEntity.remove(); RidableDolphinEnitity sobstitue = new RidableDolphinEnitity(worldIn); sobstitue.setPosition(dolphinEntity.lastTickPosX, dolphinEntity.lastTickPosY, dolphinEntity.lastTickPosZ); worldIn.addEntity(sobstitue); player.startRiding(sobstitue); } } } But when i test it and i right-click the dolphine disappear and i'm freezed, where i'm wrong? Edited May 3, 20205 yr by ArcaneDiver
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.