Convert codebase to JMC #1
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
data/*
|
||||
@ -1,3 +0,0 @@
|
||||
scoreboard objectives add transportCreative trigger
|
||||
scoreboard objectives add transportSMP trigger
|
||||
scoreboard objectives add menu trigger
|
||||
@ -1 +0,0 @@
|
||||
guis open menu
|
||||
@ -1 +1 @@
|
||||
transfer 10.0.0.13 25566 @s
|
||||
transfer 10.0.0.13 25566
|
||||
@ -1 +1 @@
|
||||
transfer 10.0.0.13 25565 @s
|
||||
transfer 10.0.0.13 25565
|
||||
@ -1,11 +0,0 @@
|
||||
scoreboard players enable @a transportCreative
|
||||
execute as @a[scores={transportCreative=1..}] run function ferdinland:command/transport_creative
|
||||
scoreboard players set @a transportCreative 0
|
||||
|
||||
scoreboard players enable @a transportSMP
|
||||
execute as @a[scores={transportSMP=1..}] run function ferdinland:command/transport_smp
|
||||
scoreboard players set @a transportSMP 0
|
||||
|
||||
scoreboard players enable @a menu
|
||||
execute as @a[scores={menu=1..}] run function ferdinland:command/menu_open
|
||||
scoreboard players set @a menu 0
|
||||
@ -1,3 +0,0 @@
|
||||
# load function
|
||||
say This load function
|
||||
function ferdinland:command/init
|
||||
@ -1,4 +0,0 @@
|
||||
# tick function
|
||||
#
|
||||
|
||||
function ferdinland:command/trigger
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"values": [
|
||||
"ferdinland:load"
|
||||
"ferdinland:__load__"
|
||||
]
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"values": [
|
||||
"ferdinland:tick"
|
||||
"ferdinland:__tick__"
|
||||
]
|
||||
}
|
||||
7
jmc_config.json
Normal file
7
jmc_config.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"namespace": "ferdinland",
|
||||
"description": "Custom datapack for the Ferdinland Minecraft Server",
|
||||
"pack_format": "48",
|
||||
"target": "main.jmc",
|
||||
"output": "."
|
||||
}
|
||||
5
main.hjmc
Normal file
5
main.hjmc
Normal file
@ -0,0 +1,5 @@
|
||||
#define createObjTrigger(x) scoreboard objectives add x trigger
|
||||
#define createObjDummy(x) scoreboard objectives add x dummy
|
||||
|
||||
#command guis
|
||||
#command transfer
|
||||
5
main.jmc
Normal file
5
main.jmc
Normal file
@ -0,0 +1,5 @@
|
||||
import "src/*";
|
||||
|
||||
say "I want to say load";
|
||||
|
||||
function __tick__() {}
|
||||
@ -1,10 +1,6 @@
|
||||
{
|
||||
"__comment": "The datapack is assembled by Datapack Assembler",
|
||||
"__link": "https://far.ddns.me",
|
||||
"__patreon": "Thank you to Someone, NatNATTO, Andrew and CadeMade for the support on https://patreon.com/GalSergey",
|
||||
|
||||
"pack": {
|
||||
"description": "Custom datapack for the Ferdinland Minecraft Server",
|
||||
"pack_format": 48
|
||||
"pack_format": 48,
|
||||
"description": "Custom datapack for the Ferdinland Minecraft Server"
|
||||
}
|
||||
}
|
||||
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
34
src/commands.jmc
Normal file
34
src/commands.jmc
Normal file
@ -0,0 +1,34 @@
|
||||
@lazy
|
||||
function triggerCommand(objective, function) {
|
||||
scoreboard players enable @a $objective;
|
||||
execute as @a[scores={$objective=1..}] run function $function;
|
||||
scoreboard players set @a $objective 0;
|
||||
}
|
||||
|
||||
class command {
|
||||
@add(__load__)
|
||||
function commandsLoad() {
|
||||
createObjTrigger(transportCreative);
|
||||
createObjTrigger(transportSMP);
|
||||
createObjTrigger(menu);
|
||||
}
|
||||
|
||||
@add(__tick__)
|
||||
function commandsTick() {
|
||||
triggerCommand(transportCreative, this.transport_creative());
|
||||
triggerCommand(transportSMP, this.transport_SMP());
|
||||
triggerCommand(menu, this.menu());
|
||||
}
|
||||
|
||||
function transport_creative() {
|
||||
transfer 10.0.0.13 25566;
|
||||
}
|
||||
|
||||
function transport_SMP() {
|
||||
transfer 10.0.0.13 25565;
|
||||
}
|
||||
|
||||
function open_menu() {
|
||||
guis open menu;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user