Jump to content

[1.9] Particle Effect Stream | Damage Player Touching Side/Infront of Block


Recommended Posts

Posted

I have three questions for today:

[*]So currently have a block that will make a flame thrower like particle effect when activated with redstone. The problem is that I have put this code in renderUpdateTick and as such it does not activate nearly fast enough to make a steady steam of particles. Is there some way I can make it tick faster or should I be doing something else to get it to output a stream of particles?

[*]I want to make a block that only damages players if they are colliding with it from a certain side (whichever side the block is facing), is there an easy way to do this? Or should I simply just add a check in onEntityCollidedWithBlock()?

[*]My last question builds on from the last question. I want to make a block that damages the player if they are within three blocks in the direction the block was faced. I don't really know how I would go about this, any suggestions?

No signature for you!

Posted

I have three questions for today:

[*]So currently have a block that will make a flame thrower like particle effect when activated with redstone. The problem is that I have put this code in renderUpdateTick and as such it does not activate nearly fast enough to make a steady steam of particles. Is there some way I can make it tick faster or should I be doing something else to get it to output a stream of particles?

[*]I want to make a block that only damages players if they are colliding with it from a certain side (whichever side the block is facing), is there an easy way to do this? Or should I simply just add a check in onEntityCollidedWithBlock()?

[*]My last question builds on from the last question. I want to make a block that damages the player if they are within three blocks in the direction the block was faced. I don't really know how I would go about this, any suggestions?

No signature for you!

Posted

1) spawn more particles per tick with horizontal offsets from each other.

2) make the block less than a full block on that side.

3) step 1: get the facing direction step 2: multiply that direction by 3 step 3: make an AABB from the block to this new position

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

1) spawn more particles per tick with horizontal offsets from each other.

2) make the block less than a full block on that side.

3) step 1: get the facing direction step 2: multiply that direction by 3 step 3: make an AABB from the block to this new position

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

1) spawn more particles per tick with horizontal offsets from each other.

2) make the block less than a full block on that side.

3) step 1: get the facing direction step 2: multiply that direction by 3 step 3: make an AABB from the block to this new position

 

1) Works perfectly, thanks!

3) So this works mostly. The actual collision box of the block is now 2 blocks in the direction the block is facing (I'm meant to actually just collide with the block, but take damage when within 3 blocks of the block. I just kinda collide with the air), but the bounding box is shown to be 4 blocks in the direction (which is correct). Also the onEntityCollideWithBlock() method never gets called even when I'm touching the block

No signature for you!

Posted

1) spawn more particles per tick with horizontal offsets from each other.

2) make the block less than a full block on that side.

3) step 1: get the facing direction step 2: multiply that direction by 3 step 3: make an AABB from the block to this new position

 

1) Works perfectly, thanks!

3) So this works mostly. The actual collision box of the block is now 2 blocks in the direction the block is facing (I'm meant to actually just collide with the block, but take damage when within 3 blocks of the block. I just kinda collide with the air), but the bounding box is shown to be 4 blocks in the direction (which is correct). Also the onEntityCollideWithBlock() method never gets called even when I'm touching the block

No signature for you!

Posted

No no no, leave the collision box alone.  You want to getEntitiesWithinAABB(thing I said)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

No no no, leave the collision box alone.  You want to getEntitiesWithinAABB(thing I said)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Oh, I didn't get that you meant getEntitiesWithinAABB, I kind a just read it as BB and thought I needed to change the bounding box.

 

So I'm meant to call worldIn.getEntitiesWithinAABB() and then damage all entities. But what method do I put that in?

 

It wouldn't be onEntityCollidedWithBlock, because that never gets called.

No signature for you!

Posted

Oh, I didn't get that you meant getEntitiesWithinAABB, I kind a just read it as BB and thought I needed to change the bounding box.

 

So I'm meant to call worldIn.getEntitiesWithinAABB() and then damage all entities. But what method do I put that in?

 

It wouldn't be onEntityCollidedWithBlock, because that never gets called.

No signature for you!

Posted
because that never gets called

 

It gets called if the player is inside the 1x1x1 standard volume of the block (your block would need a bounding box smaller than 1x1x1 for this to occur).

 

You would need to either:

a) schedule tick updates (say, every 10 ticks) and check in updateTick (and reschedule the update)

b) not schedule ticks and rely on random ticks (about once a minute)

c) use a tile entity and check every tick

 

A is the best solution.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
because that never gets called

 

It gets called if the player is inside the 1x1x1 standard volume of the block (your block would need a bounding box smaller than 1x1x1 for this to occur).

 

You would need to either:

a) schedule tick updates (say, every 10 ticks) and check in updateTick (and reschedule the update)

b) not schedule ticks and rely on random ticks (about once a minute)

c) use a tile entity and check every tick

 

A is the best solution.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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