#Hi I wanna create a datapack for my Server.

1 messages · Page 1 of 1 (latest)

glacial raptor
#

Basically if a player dies they should get banned for 24 hours. And a function that checks users gamemode and if its not survival it changes it to survial. I tried following some tutorials but it didnt work.

as an example death.mcfunction

scoreboard objectives add deaths deathCount
scoreboard objectives add ban dummy
scoreboard players set @a ban 0

execute as @a[scores={deaths=1..}] run scoreboard players set @s ban 1
execute as @a[scores={deaths=1..},scores={ban=1..}] run ban @s 24h
execute as @a[scores={ban=1..}] run tellraw @s ["",{"text":"Du bist gebannt für noch ","color":"red"},{"score":{"name":"@s","objective":"ban"},"color":"red"},{"text":" Stunden.","color":"red"}]
clear copperBOT
#
**Someone will come and help soon!**

💬 While you wait, take this time to provide more context and details. What are you trying to achieve overall - maybe there's an easier way to solve this problem

🙇 If it's been 30 minutes and you're still waiting for someone to help, hit the Summon Helpers button to call the official helpers here

✅ Once your question has been resolved (or you no longer need it), hit the Resolve Question button or run /resolve

somber kraken
#

like i know what you are trying to achieve

#

but what you get instead?

#

OHH

quartz warren
#

You need to make sure function_permission_level in the server.properties is set to 4 for a start

somber kraken
torn oak
somber kraken
stone garden
#

it should be simple

torn oak
quartz warren
#

ban command also doesn’t support time iirc

#

You can use a function macro

#

Store the banned players names in a storage, then use a macro to pardon them

torn oak
#

then use some sort of time library so its not measured in ticks

somber kraken
stone garden
#

amandin

somber kraken
stone garden
#

i remember when your thing was aaaaaaaaaaaaaaaamandin

somber kraken
#

thats the closest thing you can achieve with datapack only

quartz warren
#

you can kick them every tick yeah

stone garden
#

sigma male

torn oak
somber kraken
quartz warren
#

to know when time has passed fully, you can get the system time using a command block’s LastOutput NBT (it says the time that it runs in the output)

torn oak
somber kraken
stone garden
#

me to

torn oak
quartz warren
#

banning them would be just as easy

stone garden
#

i dont know how to do the strikethrough thing tho

quartz warren
stone garden
#

just schedule it every 24hrs to stop

quartz warren
stone garden
#

and kick them every tick

somber kraken
quartz warren
#

it doesn’t keep context

somber kraken
#

or scoreboard

quartz warren
#

also server restarts

glacial raptor
quartz warren
#

or downtime

somber kraken
quartz warren
somber kraken
torn oak
quartz warren
#

That’s why I said

glacial raptor
somber kraken
somber kraken
stone garden
#

wait you get errors?

#

lol i dont

#

i usally have to wing it

quartz warren
somber kraken
#

he's on a server dude..

somber kraken
quartz warren
#
  • how do you increase 1 on a scoreboard if you don’t know the scoreboard holder
somber kraken
#

oh wait i know the perfeKt solution if you know what i am talking about 😏

#

but

stone garden
#

i dont

glacial raptor
somber kraken
somber kraken
glacial raptor
#

sure

stone garden
#

only 2kb?

glacial raptor
#

because I absolutely dont know anything about em

stone garden
#

there like command blocks

#

but more efficent

#

and better

somber kraken
clear copperBOT
#
Quick Look

data/namespace/functions/death.mcfunction:

scoreboard objectives add deaths deathCount
scoreboard objectives add ban dummy
scoreboard players set @a ban 0

execute as @a[scores={deaths=1..}] run scoreboard players set @s ban 1
execute as @a[scores={deaths=1..},scores={ban=1..}] run ban @s 24h
execute as @a[scores={ban=1..}] run tellraw @s ["",{"text":"Du bist gebannt für noch ","color":"red"},{"score":{"name":"@s","objective":"ban"},"color":"red"},{"text":" Stunden.","color":"red"}]```
stone garden
#

lol

#

forgot

#

to set it

#

to your nampspace

quartz warren
#

What’s the point of death.json

quartz warren
somber kraken
stone garden
#

oh ok

somber kraken
#

why didnt i know

#

this is ridiculously good

quartz warren
glacial raptor
stone garden
#

bro

somber kraken
stone garden
#

i could just stop confusing the hell out of people when trying to explain my layout

glacial raptor
stone garden
#

bruh

somber kraken
stone garden
#

ai will never do anything

#

good for you

somber kraken
#

i mean if you ask it for things it is good at

#

like essays or python scripting

#

not minecraft 💀

stone garden
#

if you want premium code you got to bake it yourself

#

or get help baking it

#

astol i have a tip for you

glacial raptor
#

ik like c#, cpp whatever isnt a problem for me and i tried to make a datapack fast xD

stone garden
#

functions are made by using .mcfunctions not .json files

somber kraken
stone garden
#

json is for advancments and other stuff just not mcfunctions

stone garden
#

another tip

#

dont rush it takes time

#

shut up

#

amandin

glacial raptor
stone garden
#

chat gpt

#

really

somber kraken
somber kraken
glacial raptor
stone garden
#

chat gpt is really good for essays

#

like when i made a essay about baked beans

#

with chat gpt

somber kraken
#

your datapack is kind of a nonsense to be honest, your only option seems to learn how to make datapacks yourself

stone garden
#

astol

#

ill give you a making datapack video it really helped me

somber kraken
#

@glacial raptor are you familiar with minecraft commands? have you made stuff with command blocks?

stone garden
#

Working in 1.19, 1.18, 1.17 and 1.16! Learn how to make a datapack in minecraft 1.19 with my hot new datapack tutorial! I only cover functions in this tutorial because I think that's the most useful feature of datapacks. Leave a comment if you have questions!

===Important Links!===
Visual Studio Code: [ http://code.visualstudio.com/ ]
Datapack ...

▶ Play video
#

here astol

#

it tells you the basics

#

then theres command videos that he does to

glacial raptor
#

alright

stone garden
#

and if that doesnt work always get help and take your time

somber kraken
stone garden
#

oh ye

#

btw

#

@glacial raptor

#

what version are you planning on this datapack

somber kraken
#

first you should watch this playlist till 10th video and you can pretty much skip the first video since its telling you nothing. every video is 7-14 minutes or so
https://www.youtube.com/playlist?list=PL4ZS2guXqa_jVrj73ZBl4zkkz_BdEVEb5
you may just watch it briefly

then you just go and watch these in given order but here as you watch the video you should immediately go test it
https://youtu.be/ac6V5-KT6Rg?si=dzOwtohZVppZrOSq
https://youtu.be/EBsEDkFpPlI?si=RBCBpsqF5oHqeU6X
https://youtu.be/-5EmWJguggA?si=MPY14_eWiWXcmSez
https://youtu.be/BF4MZHDsLPY?si=vMfVXx3vI2NMpCOh
https://youtu.be/9j8nNL3oBWo?si=uuTNx8rqjWPxw59r

check out this too https://discord.com/channels/935560260725379143/1167509112377069618

and that alone is gonna get you very strong basic knowledge
@glacial raptor

stone garden
#

AYYYYYYYYYY

somber kraken
#

thatss like

stone garden
#

you suggested the same making datapck one that i suggested

somber kraken
#

yea

#

i watched it when i first made datapack

#

lol

stone garden
#

me to like 5 days ago

somber kraken
#

ong

stone garden
#

i autcally need to watch that playlist

glacial raptor
clear copperBOT
somber kraken
stone garden
#

in the pack.mcmeta

somber kraken
glacial raptor
stone garden
#

it works for me

#

sense you used ai it got some stuff wrong causing it to not workin

somber kraken
#

most helpful tip: dont use ai to write commands for you

#

you can use it to figure out some math formulas and then implement in datapack, but no more

quartz warren
somber kraken
#

oh

#

great job on it

stone garden
#

what did he make?

somber kraken
#

quick look

somber kraken
# quartz warren I did

it fails to open load.mcfuntion because of the wrong file extension, is this intentional

#

oh wait

#

no im probably mistaken

#

its old iteraction so it maybe expired and i cant use it

clear copperBOT
#
Quick Look

data/namespace/functions/death.mcfunction:

scoreboard objectives add deaths deathCount
scoreboard objectives add ban dummy
scoreboard players set @a ban 0

execute as @a[scores={deaths=1..}] run scoreboard players set @s ban 1
execute as @a[scores={deaths=1..},scores={ban=1..}] run ban @s 24h
execute as @a[scores={ban=1..}] run tellraw @s ["",{"text":"Du bist gebannt für noch ","color":"red"},{"score":{"name":"@s","objective":"ban"},"color":"red"},{"text":" Stunden.","color":"red"}]```
somber kraken
#

it does work

#

sorry for the ping lol

cerulean pewter
somber kraken
cerulean pewter
somber kraken
cerulean pewter
somber kraken
torn oak