Jump to content

Adixe

Members
  • Posts

    9
  • Joined

  • Last visited

Adixe's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thank you for your answer! Could I ask for more details? I've looked at the Snowball class and the ThrownItemRenderer class, but unfortunately it doesn't tell me much.
  2. Thanks for the answer! However, my point is to set the speed constant, not by editing the time of the entire rotation.
  3. Hello I have a question. I want to display a particle that will move around a circle. Currently, my method for ticking looks like this: @Override public void tick() { super.tick(); x = centerX + radius * Math.cos(2 * Math.PI * (age / 20f) / time); z = centerZ + radius * Math.sin(2 * Math.PI * (age / 20f) / time); } The "time" variable means the time it takes the particle to complete one circle. The problem is that changing the radius value changes the speed of the particle. I want a constant speed, independent of the radius. How can I get rid of the time variable? Ideally, the speed should be predefined. This means that regardless of the radius of the circle, the particle always moves at a fixed speed. Then "time" will be unnecessary. Is there a way? I will be grateful for your help!
  4. Hello I have a question. I want to create a particle that will not render towards the player's camera. By default all particles render towards the camera. I want the particle to rotate towards a specific position, not the player's position. I think I need to use the "render" method from the Particle class. Unfortunately, I don't know how to solve this problem technically and metamatically. I will be grateful for any help!
  5. Thanks for answer! Is it possible to call some function for each block instance on world join? Then I could check the state of the block and possibly schedule a task to play the sound.
  6. Hello I have a question. I want to create a simple block mechanic: make a sound when powered by redstone. I assigned the property "powered" to the block. I also created a system that manipulates its value accordingly. I managed to make that when a signal is detected, the sound is played. But how do I make it play in a loop until the signal is interrupted? Please note that when you rejoin the world, the activity is supposed to resume. My existing code: @Override public void neighborChanged(BlockState blockState, Level level, BlockPos blockPos, Block block, BlockPos p_60513_, boolean p_60514_) { if (!level.isClientSide()) { if (blockState.getValue(POWERED) != level.hasNeighborSignal(blockPos)) { BlockState cycledBlockState = blockState.cycle(POWERED); level.setBlock(blockPos, cycledBlockState, 2); if (cycledBlockState.getValue(POWERED)) level.playSound(null, blockPos, MyMod.SOUND.get(), SoundSource.BLOCKS, 2, 1); //This plays a single sound } } }
  7. Oh, thanks! I hadn't thought of such a solution. Indeed, I found everything I need. Next time I'll just look at a similar block.
  8. Hello, I have a problem. I have created a class representing my block that extends the Block class. I want to implement lamp-like behavior: the block can be powered or not. I want to detect this change somehow. Unfortunately, after a long time of searching, I couldn't find a solution. On the Internet I found the use of various methods from the BlockBehaviour class, but most of them are deprecated, e.g. use, neighborChanged, getSignal, etc. Is there any substitute for such methods? I will be grateful for your help!
  9. Hello, I have a question. I plan to start working on a mod that adds some weather improvements. I don't have much experience, so I want to gather as much information as possible to avoid problems in the future. Well, I'm wondering about a good way to display certain things to the player. Let's start with, for example, clouds. I want to make a lot of changes here, including direction of movement (like wind), dynamics, color depending on weather, etc. What is the best way to do this? I'm thinking of doing it via particle, but maybe there are better ways out. A similar situation occurs with rain. I plan to make it dynamically dependent on the wind. Then what method should I use? I will be grateful for any tips and advice. I will add that I am interested in 1.19.3.
×
×
  • Create New...

Important Information

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