How to make a damage dealing block deal no more damage by haveing boots equipped?

Started by Hygerian on

Topic category: Help with modding (Java Edition)

Last seen on 00:41, 17. May 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a damage dealing block deal no more damage by haveing boots equipped?

Hello,
I wanted to ask you something.
Basically I want to make a Block that deals damage to you (eats you) but if you have boots equipped you get no more damage and an advancement
Can someone please help me with a clear explaination or pictures?
Thanks!

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There are two ways to do…
Wed, 11/22/2023 - 20:23

There are two ways to do this: one is to make the block not fully solid, (so the block would appear to be 16*16 pixels, but would allow the player to collide inside it a little, like a honey block), or having the block be solid, but targeting things that are touching it. I'm going to assume you're doing the second option, though if you want to go with the first, just ignore the scond bit about targeting the player and use the 'when entity collides with block' function instead.

  • Make a procedure that triggers on block update tick. The duration you use between ticks will determine how often it attacks.
  • In the procedure, use an 'entity iterator' bracket with a radius of 1*1*1, at position x+0.5, y+0.6, z+0.5. (This will target every entity in a 1*1*1 cube centered 1 pixel above the block. If you instead use a 1.1 * 1.1 * 1.1 cube centered at x+0.5, y+0.5, z+0.5; it will instead target everything touching any side of the block.)
  • Inside the bracket, deal some damage to the entity iterator, maybe play a sound, etc. (You need to target the entity iterator, which is the currently selected entity out of each one the block is targeting, if it finds any entities.)
  • You could also consider using an nbt tag for the block as a timer to make it attack immediately when an entity collides, and then have a set delay. This would be a little bit more complicated though.

I can send a screenshot if that would be helpful.

Last seen on 00:41, 17. May 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mindthemoods This was very…
Wed, 11/22/2023 - 20:32

Mindthemoods This was very helpful but it would be nice if you could send a screenshot of the procedure, it would make everything a whole lot easier!
I probably go with the 2nd version + can I also make it so it detects if you wear boots and if true than you get a advancement?

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The boots part is easy…
Thu, 11/23/2023 - 04:13

The boots part is easy enough, just use an 'if' bracket for if the entity iterator has boots, and... 

Actually this is easier to explain visually. The procedure should look something like this: (Ignoring the mistake on the advancement block. You want to give the advancement to the entity iterator, NOT the event/target entity, I just forgot to change it. Easy to make that sort of mistake, but very important you're reffering to the right thing.)

You'd want to run this procedure on the block's update tick. (Again, the duration between update ticks will determine how frequently it attacks.)

You could also add in play-sound or particle functions, and you might consider damaging the entity iterator's boots if they're wearing boots, instead of damaging the entity directly. 

And again, changing the radius or the position of the entity iterator will change where/which sides it attacks on.

 

Last seen on 00:41, 17. May 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mindthemoods  I have a…
Thu, 11/23/2023 - 11:49

Mindthemoods 

I have a problem.
I did everything you said and it wont let me select the "Block Tick Update" because there are missing dependencies.
Could you please help me again?
And I wanted to also ask you if you could also show where I can put the boots part
Thanks!

Picture:
https://ibb.co/dt2TkSX

Last seen on 00:41, 17. May 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mindthemoods  I have a…
Thu, 11/23/2023 - 12:01

Mindthemoods 

I have a problem.
I did everything you said and it wont let me select the "Block Tick Update" because there are missing dependencies.
Could it be the Armor slot block?
I just changed the Armor slot block to entity iterator, Now I can select "Block Tick Update" and load into the game but the block doesn't do any damage
Could you please help me again?
And I wanted to also ask you if you could also show where I can put the boots part
Thanks!

Picture:
https://ibb.co/dt2TkSX

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yep, it's the armor slot…
Thu, 11/23/2023 - 15:52

Yep, it's the armor slot block, that should also have 'entity iterator' instead of 'event/target entity.' Sorry, I should've double checked!

Last seen on 00:41, 17. May 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mindthemoods yes but still…
Thu, 11/23/2023 - 16:21

Mindthemoods 
yes but still it doesn't do any damage even though i did everything right

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you maybe link a…
Thu, 11/23/2023 - 16:23

Could you maybe link a picture of the procedure? If you’ve written it correctly it’s also possible the block hasn’t been set to tick automatically, or the procedure hasn’t been linked.

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry, didn't see the link.
Thu, 11/23/2023 - 16:45

Sorry, didn't see the link.

Last seen on 00:41, 17. May 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here are all the pictures, I…
Thu, 11/23/2023 - 16:47

Here are all the pictures, I also tried using Player and Server player but this doesn't work either!

Pictures:
 

https://ibb.co/CPm06XS
https://ibb.co/tXxt64h
https://ibb.co/Z8hgvkR
https://ibb.co/NtN0Q4L

(The pictures of me ingame should show that this doesnt do damage)

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry, didn't see the links!…
Thu, 11/23/2023 - 16:52

Sorry, didn't see the links!

Your procedure looks correct, and you've linked it to the correct trigger. The only thing I guess I would double check is that the block itself is set to tick automatically? In advanced settings, you should be able to set the block to not tick, tick automatically with a provided duration, or tick randomly. You want it to tick automatically, with something like a ten tick delay. (So it would deal damage very half a second.) I assume you're testing it in survival mode.

If it still isn't working, I'm not sure what the issue is. I use a nearly-identical procedure for something in one of my mods, and it's worked so far. You could maybe try adjusting the position or the radius, but those should be correct already. Apologies for being so forgetful today, I've been kinda busy lately!

Last seen on 00:41, 17. May 2024
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I had this Tick feature on,…
Thu, 11/23/2023 - 17:03

I had this Tick feature on, but it still doesnt work
and you dont need to apologies, I am just thankful for your help.
Well maybe if you come up with something else text me

https://ibb.co/ct82YjD

Last seen on 11:41, 17. May 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The only thing different…
Thu, 11/23/2023 - 17:14

The only thing different with the version I use is that it uses a 1.1*1.1*1.1 sized cube centered at x+0.5, y+0.5, z+0.5; it uses a different means of armor detection, (You could try checking if the item in the slot is tagged under boots; but this should be working regardless), and I use a custom source of damage instead of a vanilla one. I could link you a procedure file, maybe?