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

Hello ! I have a little problem, and I'd like if someone was able to help me with it.

 

Basically, I have an entity that acts like a boomerang. It goes well for the first half : I throw it, it goes in the direction it should be going, and whenever it hits the limit distance, or collide, it becomes invisible.

 

I guess this comes from the "returnToOwner();" method, since whenever it is called, the entity get invisible.

 

 

Here are my codes :

 

 

 

Item class :

https://github.com/Gugu42/RatchetAndClankMod/blob/master/com/gugu42/rcmod/items/ItemOmniWrench3000.java

 

Entity class :

https://github.com/Gugu42/RatchetAndClankMod/blob/master/com/gugu42/rcmod/entity/projectiles/EntityWrenchThrown.java

 

Render class :

https://github.com/Gugu42/RatchetAndClankMod/blob/master/com/gugu42/rcmod/render/RenderThrownWrench.java

 

Also, if I remove the line if(!par2World.isRemote) in my Item class, I see a bug :

When I throw the item, I see it two times, and when it collides / must return to me, one gets invisible, and the other stays visible. However, the one I see working well is just a render, and it does not make the action, while the semi-working one breaks the crate etc...

 

I really can't find out what the problem is. Thanks for the help you can give me.

One observation is that the way you have this written it will call return to owner every tick after it reaches the timer.  Might be on purpose, but can't tell.

 

My guess at your problem is that ther is no owner.

 

You need to ad some log points in the code and watch for certain parts if the code to happen.  That will find it.

Long time Bukkit & Forge Programmer

Happy to try and help

  • Author

Making it return to the owner is simply so it knows where to go every tick.

 

What happens is that when it gets to the point of returning, it determines the position it is going to go.

However, if the owner move, it will still go to the point the owner was when it started returning.

 

I'm simply updating the place it's going to every tick.

 

Also, I checked, there is an owner.

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.