Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.