-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56cfcf2
commit 03a25d6
Showing
10 changed files
with
114 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
__version__ = "0.1.5" | ||
__version__ = "0.1.6" | ||
|
||
from .util import * | ||
|
||
from .commands.tag import tag | ||
from .commands.time import time | ||
from .commands.team import team | ||
from .commands.item import item | ||
from .commands.effect import effect | ||
from .commands.bossbar import bossbar | ||
from .commands.execute import execute | ||
from .commands.teleport import teleport | ||
from .commands.experience import experience | ||
from .commands.scoreboard import Scoreboard | ||
|
||
from .commands.simple import * | ||
|
||
|
||
# Aliases | ||
sb = Scoreboard | ||
xp = experience | ||
exec = execute | ||
gm = gamemode | ||
tp = teleport | ||
bb = bossbar | ||
bb = bossbar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from pymcfunction.update_specific_types.effect import Effect | ||
|
||
|
||
class effect: | ||
def __init__(self, target: str = "@s") -> None: | ||
self.target = target | ||
|
||
def give( | ||
self, | ||
effect: Effect, | ||
seconds: int = None, | ||
amplifier: int = None, | ||
hideParticles: bool = None, | ||
): | ||
return f"effect give {self.target} {effect.value}" + ( | ||
" " | ||
+ ( | ||
str(seconds) | ||
+ ( | ||
" " | ||
+ ( | ||
str(amplifier) | ||
+ ( | ||
" " + ("true" if hideParticles else "false") | ||
if hideParticles != None | ||
else "" | ||
) | ||
) | ||
if amplifier | ||
else "" | ||
) | ||
) | ||
if seconds | ||
else "" | ||
) | ||
|
||
def clear(self, effect: Effect = None) -> str: | ||
return f"effect clear {self.target}" + ((" " + effect.value) if effect else "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from pymcfunction.types import ExperienceUnit | ||
|
||
|
||
class experience: | ||
def __init__(self, selector: str = "@s") -> None: | ||
self.selector = selector | ||
|
||
def add(self, anmount: int, unit: ExperienceUnit): | ||
return f"xp add {self.selector} {anmount} {unit.value}" | ||
|
||
def remove(self, anmount: int, unit: ExperienceUnit): | ||
# xp remove is not an actual command in the game, | ||
# but uses xp add with a negative anmount | ||
return self.add(anmount * -1, unit) | ||
|
||
def query(self, unit: ExperienceUnit): | ||
return f"xp query {self.target} {unit.value}" | ||
|
||
def set(self, anmount, unit: ExperienceUnit): | ||
return f"xp set {self.selector} {anmount} {unit.value}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pymcfunction.types import TimePreset, TimeQueryType | ||
|
||
|
||
class time: | ||
def __init__(self) -> None: | ||
pass | ||
|
||
def add(self, _time: int): | ||
return f"time add {_time}" | ||
|
||
def set(self, _time: int | TimePreset): | ||
return "time set " + (str(_time) if type(_time) == int else _time.value) | ||
|
||
def query(self, type: TimeQueryType): | ||
return f"time query {type.value}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
namespace = "testdp" | ||
compiled_folder_name = "testdpfolder" | ||
description = "Test datapack" | ||
datapack_folder = "/run/media/paddecraft/4EE0F299E0F2870D/Dev/PythonScripting/pyfunction/test" | ||
#datapack_folder = "/run/media/paddecraft/4EE0F299E0F2870D/Dev/PythonScripting/PyMCFunction/test" | ||
datapack_folder = "." | ||
pack_version = 10 | ||
|
||
[includes] |