Jershy Posted June 16, 2014 Posted June 16, 2014 I want to use the base game loop that almost all the functions of Minecraft uses. Unfortunately the answers that I found for using them were outdated or irrelevant. What i want to do is create a method where a game object moves for blank every blank ticks. please help public double moveY(int par1) { int i = 0; for(i = 0, i <(ticks here), i++ { this.posY = i * par1; } return this.posY; } thank you. Quote
jabelar Posted June 16, 2014 Posted June 16, 2014 You said "game object" but what exactly did you mean. Is it an entity, or a block, or an item, or special item like armor? More importantly is it a custom object or a vanilla object? If it is a custom object, then most of the main classes you'd extend will have some sort of method like onUpdate(), or onLivingUpdate() or similar. Those methods are automatically called every tick, and since it is your own custom class you can override those methods to do what you want. If it is a vanilla object, then you need to do event handling. You can subscribe to a tick event, like the server tick event, and then find the game objects you care about (like search through all EntityCow if you wanted to modify the cows) and then do what you want. So basically it depends on exactly what object you want to affect. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Recommended Posts
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.