Jump to content

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


Recommended Posts

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.

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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