I made quite a simple data pack that will ban a player from a server if they die outside a 200 by 200 block area centered around 0,0. I want the data pack to be more configurable however, where people can change the location where the area is centered around by using a command in game. I also would like to be able to easily change how big the safe zone is, however this is not as important. Does anyone know how to do this?
#How to make my data pack configurable?
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
Someone will come and help soon!
💬 While you wait, take this time to provide more context and details.
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
<@&1166082198152159386> <@&1202694677766348840>
🙇 Helpers Arise!
Please note that you still might not immediately get a response since all helpers are human beings and volunteers (and also might be sleeping right now)
Please don't just throw your data pack at us
Simplest way to make it configurable would be to have some kind of setup command that spawns a marker entity, and have the 200x200 area centered on that entity instead of a static coordinate. The command could first kill all existing markers with that tag before summoning the new one, allowing it to be moved
You could probably theoretically make it configurable with macros instead, but the performance trade-off should be negligible
This was my original method, however using the r target selector leads to issues such as the area being a circle instead of a rectangle, which isn’t a huge deal but I am making this data pack for my friend and he told me he really did not want it to be a circle. It also leads to issues if you go to high up
r? That target selector arguments hasn't existed in years
Assuming you're working in any recent version, you can use the dx dy and dz target selector arguments to make a cuboid volume area rather than a circle
summon marker with the tag "kill_center", then execute at @e[type=marker,tag=kill_center] positioned ~-200 ~-300 ~-200 run kill @a[dx=400,dy=6000,dz=400]
Don't do this
🥺
What's the issue? maybe I can improve it
It kills all players in a 400 block cube around the marker
yeah
oh he wanted 200
Then do this
summon marker with the tag "kill_center", then execute at @e[type=marker,tag=kill_center] positioned ~-100 ~-300 ~-100 run ban @a[dx=200,dy=6000,dz=200]
No...
He doesn't want to kill people within the designated area
Its great to see people helping in the help channels, but please make absolutely certain you are providing relevant information that solves the user's problem. If you aren't sure, it's okay to sit it out.
Sorry, i changed it to ban
That's still not what they want
And also not what they're asking for.
You're not contributing anything to this thread, I have to respectfully ask you to step away
This is what I did. However I’m not sure how to allow for easy customization in game with this set up. Also I’m sorry for my mistake with r, I was doing some commands on bedrock, I was actually referring to the distance argument
I guess I don't understand what else you'd want to customize.
The issue is the coordinates are hardcoded into the data pack right now, and I want to create an easy command so people can change where the area is centered around, which I have found difficult due to Minecraft’s lack of variables except in the case of scoreboards which don’t work in this case
Ok, well I did describe how to change the centerpoint.
But if you want to change the radius then you'll have to use macros
I didn’t think that would work because it relys on using the distance argument which I can’t use due to reasons described above
It doesn't rely on using the distance argument... As I said, you can use dx dy and dz.
Distance = real/vector distance
Dx = distance on x-axis
Dy = distance on y-axis
Dz = distance on z-axis
An entity that stands on the same block as you do along the x-axis would be: @n[dx=0.5] this could be some entity below or above you, or beside you.
@e[dx=5,dy=5,dz=5] would be a cube extending 5 blocks from the position it runs at (10x10x10)
@e[distance=5] would be a sphere that fits in the above cube, the corners of the cube however fall outside of this sphere.