Posted June 18, 201312 yr Im making a gun based on bow bt i want to make it fire like every 150 miliseconds, not when releasing mouse button. I tries Thread.sleep but it stops WHOLE game (?) and trying onUpdate counter but that was even worse. Is there some way to count ticks or directly wait in while cycle? http://i.imgur.com/ZAoTYCc.png[/img]
June 18, 201312 yr Create a counter in the NBT data and add one onto it each tick (using onUpdate), then do if(counter >= 4) //4 game ticks = 0.2 seconds { //shoot counter=0; } else counter++; github
June 19, 201312 yr How is this even related to what you are asking in the thread title ? Anyway,NBT data is a data format that Notch implemented to save and load informations of Entities,items(ItemStacks),chunks,players,etc so you can save them when the game is closed and load them when the game is opened .
June 19, 201312 yr http://www.minecraftforum.net/topic/982336-tutorial-147-nbttagcompound-using-itemstacks-stacktagcompound-for-permanent-extra-data-storage/ That should help to explain, My suggestion was that you create an int field and increment it every so often, then shoot when it reaches a set value and reset the value. github
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.