I want make a "Jail"

Started by redtrac on

Topic category: Help with modding (Java Edition)

Last seen on 10:07, 5. Jun 2021
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want make a "Jail"

I tried to make an item that set a point, and teleport a Entity/Player to it when it get hit by the Item-user. Here are my "Results" but it doesnt work any ideas ?

 

https://imgur.com/a/8RqFm6e

Last seen on 23:41, 3. Jun 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah so basically mcreator…
Thu, 06/03/2021 - 23:14

yeah so basically mcreator does not like the idea of recipient of attack triggers, so no way to do that as of now I think

Last seen on 23:41, 3. Jun 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
without javascript ofc
Thu, 06/03/2021 - 23:14

without javascript ofc

Last seen on 10:07, 5. Jun 2021
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For now they get teleported,…
Sat, 06/05/2021 - 10:08

For now they get teleported, but only to 0 0 0 and not to the wanted postion. I only need an indicator where the player stands when he rightclicked.

Last seen on 16:36, 14. Sep 2022
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what are the results when…
Sat, 06/05/2021 - 10:16

what are the results when you try it? i may be able to help

Last seen on 19:49, 18. Mar 2024
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I mean you could do a "jail…
Mon, 06/28/2021 - 10:53

I mean you could do a "jail dimension" where at 0 0 0 there is a jail structure spawned

Last seen on 01:41, 8. Jan 2024
Joined May 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If I'm understanding you…
Tue, 06/29/2021 - 05:17

If I'm understanding you correctly, you're wanting an item that makes an entity stuck, or "jails" them for a desired period of time. One way to do this would be to set a trigger for when an entity is hit with the item that gives it the maximum value of slowness (255) which will effectively freeze the entity in place. You can then specify the time in ticks that the effect will last and whether or not you want it to show particles. Obviously, this method has the side effect of ridiculously zooming in the player's FOV due to the high value of the effect, but it's what I can think of right now. I hope this helps. Have a great day! :D

Last seen on 02:40, 4. Jan 2022
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Entity hurt If source…
Tue, 06/29/2021 - 06:15

Entity hurt

  • If source entity main hand item is (your item)
  1. Set logic NBT "Jailed" (custom tag) to True
  2. Set number NBT "JailTime" (custom tag) to 30
  3. Set number NBT "jailedX" (custom tag) to Entity x
  4. Set number NBT "jailedY" (custom tag) to Entity y
  5. Set number NBT z "jailedZ (custom tag) to Entity z

Player tick update

  • If Jailed
  1. If not Entity x is jailedX AND [Entity y is jailedY AND Entity z is jailedZ]
  2. - Move to jailedX, jailedY, jailedZ
  3. while JailTime > 0
  4. - wait 20 ticks
  5. - - Set JailTime to JailTime - 1
  6. If JailTime is 0
  7. - Set Jailed to False

 

So let me explain

When an Entity is hit with your jailing item, their custom tags are set and on next player tick the If Jailed condition will be activated and will not only teleport the player to their jailed spot (in my case ON the spot where they were hit) but it also has a 30 second timer until they are unjailed

The - are to indicate they are inside the function above (mobile cant tab sadly)

20 tick = 1 second

 

All this should work given you are in 2020.4 and up