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.

[solved][1.8.9][particles]How to summon rocket with custom properties?

Featured Replies

Posted

so, i want to do following things.

 

1> summon a firework rocket entity which blasts in 2 seconds and make particles of different colors.

What i have done >

 EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(worldIn, (double)((float)pos.getX() + hitX), (double)((float)pos.getY() + hitY), (double)((float)pos.getZ() + hitZ), new ItemStack(Items.fireworks));
         

this line is straight from ItemFirework.class and with this i can summon the rocket but i am unable to set neither its flight duration nor firework color.

 

2> i want to make a block which exerts random firework sparks around it (just like ender chest) but i want them to be of different colors all the time.

 

now i really want to know if there is a way (without adding custom firework/particle) to change the color of firework particle.

 

 

What i found >

after some messing around i found that there is this method in

         public void setColour(int colour)
            {
                float f = (float)((colour & 16711680) >> 16) / 255.0F;
                float f1 = (float)((colour & 65280) >>  / 255.0F;
                float f2 = (float)((colour & 255) >> 0) / 255.0F;
                float f3 = 1.0F;
                this.setRBGColorF(f * f3, f1 * f3, f2 * f3);
            }

 

sparkFX class but i am unable to use it.. any help is really appreciated.

 

Thank you.

  • Author

1> thats what i want to know. i dont know how can i give a NBT/config to an itemstack.

 

2>i am unable to use it because i dont see any method which takes a sparkFX object.

Guest
This topic is now closed to further replies.

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.