#How to make my data pack configurable?

1 messages · Page 1 of 1 (latest)

dry fern
#

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?

hushed sageBOT
#

<@&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

hushed sageBOT
# hushed sage <@&1201956957406109788>

<@&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)

mossy raft
#

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

dry fern
mossy raft
#

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

pine gorge
#

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]

pine gorge
pine gorge
mossy raft
#

It kills all players in a 400 block cube around the marker

pine gorge
#

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]

mossy raft
#

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.

pine gorge
#

Sorry, i changed it to ban

mossy raft
#

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

dry fern
mossy raft
#

I guess I don't understand what else you'd want to customize.

dry fern
# mossy raft 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

mossy raft
#

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

dry fern
mossy raft
#

It doesn't rely on using the distance argument... As I said, you can use dx dy and dz.

dusty idol
#

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.