-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Effect #2
base: main
Are you sure you want to change the base?
Effect #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,36 @@ | |
"red", | ||
"black", | ||
] | ||
|
||
EFFECTE: TypeAlias = Literal[ | ||
"speed", | ||
"slowness", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Es fehlen drei Effekte: darkness, luck und unluck. Bitte diese noch hinzufügen. |
||
"haste", | ||
"mining_fatigue", | ||
"strength", | ||
"instant_health", | ||
"instant_damage", | ||
"jump_boost", | ||
"nausea", | ||
"regeneration", | ||
"resistance", | ||
"fire_resistance", | ||
"water_breathing", | ||
"invisibility", | ||
"blindness", | ||
"night_vision", | ||
"hunger", | ||
"weakness", | ||
"poison", | ||
"wither", | ||
"health_boost", | ||
"absorption", | ||
"saturation", | ||
"glowing", | ||
"levitation", | ||
"slow_falling", | ||
"conduit_power", | ||
"bad_omen", | ||
"hero_of_the_village", | ||
"dolphins_grace" | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
from functools import partial | ||
|
||
from ._base import HasStub, _EntityProvider | ||
from ._types import COLOR | ||
from ._types import COLOR, EFFECT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Konnte wegen Typo dieses Befehl nicht testen (in _types heißt der Typ EFFECTE, bitte dort ausbesser), im Moment ist das ein ImportError! |
||
from ._util import ThreadSafeCachedKeyBasedFactory | ||
from .colors import color_codes | ||
from .exception import raise_on_error | ||
|
@@ -121,11 +121,14 @@ def getEntitiesAround( | |
return [e for e in entities if e is not self] | ||
|
||
def giveEffect( | ||
self, effect: str, seconds: int = 30, amplifier: int = 0, particles: bool = True | ||
self, effect: EFFECT, seconds: int = 30, amplifier: int = 0, particles: bool = True | ||
) -> None: | ||
pbool = str(not bool(particles)).lower() | ||
self.runCommand(f"effect give @s {effect} {int(seconds)} {amplifier} {pbool}") | ||
|
||
def clear_effect(self, EFFECT: str = "") -> None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bitte argument klein schreiben, und den richtigen Typen angeben: Also, |
||
self.runCommand(f'effect clear @s {effect}') | ||
|
||
def replaceItem(self, where: str, item: str, amount: int = 1, nbt: NBT | None = None) -> None: | ||
if nbt is None: | ||
self.runCommand(f"item replace entity @s {where} with {item} {amount}") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bitte Einzahl, also EFFECT anstelle von EFFECTE