Posted June 20, 201510 yr Crazy. I want to make a custom item that spawns an entity when it is right-clicked. But when right-clicked, (at entity init) it crashed. (Null-Pointer) Item class: (problematic part) http://pastebin.com/KDmA1ZRs Entity init: http://pastebin.com/hb6Cb1k3 Crash report: http://pastebin.com/faiq5j1N
June 21, 201510 yr Author entityInit(): OK, I realise I need to super() that. But for the arguments... Which 3 are the coordinates hit?
June 21, 201510 yr entityInit(): OK, I realise I need to super() that. But for the arguments... Which 3 are the coordinates hit? @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) x, y, and z are the coordinates of the block hit. This is why you always want to try and rename your parameters, otherwise you very likely have no idea what they do. http://i.imgur.com/NdrFdld.png[/img]
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.