This repository has been archived by the owner on Feb 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathmc.pyi
572 lines (525 loc) · 16.5 KB
/
mc.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
# pyr的代码补全文件
# Copyright (c) 2022 twoone3
# All rights reserved.
# last change: 2022.7.24
from enum import Enum
from typing import Any, Callable
class TitleType(Enum):
Clear = 0
Reset = 1
SetTitle = 2
SetSubtitle = 3
SetActionBar = 4
SetDurations = 5
TitleTextObject = 6
SubtitleTextObject = 7
ActionbarTextObject = 8
class TextType(Enum):
RAW = 0
CHAT = 1
TRANSLATION = 2
POPUP = 3
JUKEBOX_POPUP = 4
TIP = 5
SYSTEM = 6
WHISPER = 7
ANNOUNCEMENT = 8
JSON_WHISPER = 9
JSON = 10
class Mirror(Enum):
None_15 = 0
X = 1
Z = 2
XZ = 3
class Rotation(Enum):
None_14 = 0
Rotate90 = 1
Rotate180 = 2
Rotate270 = 3
Total = 4
class CommandPermissionLevel(Enum):
Any = 0
GameMasters = 1
Admin = 2
HostPlayer = 3
Console = 4
Internal = 5
class ParameterType(Enum):
Bool = 0 # bool
Int = 1 # int
Float = 2 # float
String = 3 # std::string
Actor = 4 # CommandSelector<Actor>
Player = 5 # CommandSelector<Player>
BlockPos = 6 # CommandPosition
Vec3 = 7 # CommandPositionFloat
RawText = 8 # CommandRawText
Message = 9 # CommandMessage
JsonValue = 10 # Json::Value
Item = 11 # CommandItem
Block = 12 # Block const*
Effect = 13 # MobEffect const*
Enum = 14 # ENUM
SoftEnum = 15 # SOFT_ENUM
ActorType = 16 # ActorDefinitionIdentifier const*
Command = 17 # std::unique_ptr<Command>
WildcardSelector = 18 # WildcardCommandSelector<Actor>
class EffectChangedType(Enum):
Add = 0
Remove = 1
Update = 2
class CommandParameterOption(Enum):
None_ = 0 # TODO:make it avaliable
EnumAutocompleteExpansion = 1
HasSemanticConstraint = 2 # be used in block or item name enum
EnumAsChainedCommand = 4 # be used in NewExecuteCommand
class GameType(Enum):
Survival = 0
Creative = 1
Adventure = 2
Spectator = 6
class SnbtFormat(Enum):
PartialNewLine = 0
AlwayNewLine = 1
Minimize = 2
class ObjectiveSortOrder(Enum):
Ascending = 0
Descending = 1
class BossEventColour(Enum):
Grey = 0
Blue = 1
Red = 2
Green = 3
Yellow = 4
Purple = 5
White = 6
class ScriptFacing(Enum):
Unknown = -1
Down = 0
Up = 1
North = 2
South = 3
West = 4
East = 5
class TagType(Enum):
End = 0
Byte = 1
Short = 2
Int = 3
Int64 = 4
Float = 5
Double = 6
ByteArray = 7
String = 8
List = 9
Compound = 10
IntArray = 11
class Vec2:
x: float
y: float
def __init__(self, x: float, y: float) -> None: ...
def __repr__(self) -> str: ...
class Vec3:
x: float
y: float
z: float
def __init__(self, x: float, y: float, z: float) -> None: ...
def __repr__(self) -> str: ...
class BlockPos:
x: int
y: int
z: int
def __init__(self, x: int, y: int, z: int) -> None: ...
def __repr__(self) -> str: ...
class Block:
name: str
type: str
id: str
pos: BlockPos
dim: int
tile_data: int
def setNbt(self, nbt): ...
def getNbt(self) -> NBT: ...
def hasContainer(self) -> bool: ...
def getContainer(self) -> Container: ...
def hasBlockEntity(self) -> bool: ...
def getBlockEntity(self) -> BlockEntity: ...
def removeBlockEntity(self) -> bool: ...
class Container:
size: int
type: str
def addItem(self, item) -> bool: ...
def addItemToFirstEmptySlot(self, item) -> bool: ...
def hasRoomFor(self, item) -> bool: ...
def removeItem(self, slot, number) -> bool: ...
def getItem(self, slot) -> Item: ...
def setItem(self, slot, item) -> bool: ...
def getAllItems(self) -> list[Item]: ...
def removeAllItems(self) -> bool: ...
def isEmpty(self) -> bool: ...
class Item:
name: str
type: str
id: int
count: int
aux: int
def __init__(self): ...
def set(self, other) -> bool: ...
def clone(self) -> Item: ...
def isNull(self) -> bool: ...
def setNull(self) -> bool: ...
def setAux(self, aux) -> bool: ...
def setLore(self, lore: list[str]) -> bool: ...
def setNbt(self, nbt) -> bool: ...
def getNbt(self) -> NBT: ...
class Command:
name: str
def __init__(self, cmd: str, desc: str, level): ...
def setEnum(self, name: str, enums: list[str]) -> str: ...
def setAlias(self, alias: str) -> bool: ...
def setSoftEnum(self, name, enums: list[str]) -> str: ...
def addSoftEnumValues(self, name, values: list[str]) -> bool: ...
def removeSoftEnumValues(self, name, values: list[str]) -> bool: ...
def getSoftEnumValues(self, name) -> list[str]: ...
def getSoftEnumNames(self) -> list[str]: ...
def mandatory2(
self,
name: str,
type: ParameterType,
description: str = "",
identifier: str = "",
option=CommandParameterOption.None_,
) -> int: ...
def mandatory(
self,
name: str,
type: ParameterType,
description: str = "",
option=CommandParameterOption.None_,
) -> int: ...
def optional2(
self,
name,
type: ParameterType,
description: str = "",
identifier: str = "",
option=CommandParameterOption.None_,
) -> int: ...
def optional(
self,
name,
type: ParameterType,
description: str = "",
option=CommandParameterOption.None_,
) -> int: ...
def overload(self, value=None) -> bool: ...
def setCallback(
self,
callback: Callable[[CommandOrigin, dict[str, CommandResult]], Any],
) -> bool: ...
def setup(self) -> bool: ...
class CommandOrigin:
type: str
type_name: str
name: str
pos: Vec3
blockpos: BlockPos
dim: int
entity: Entity
player: Player
def getNbt(self) -> NBT: ...
def toString(self) -> str: ...
class CommandOutput:
empty: bool
success_count: int
def success(self, msg=None) -> bool: ...
def error(self, msg) -> bool: ...
def addMessage(self, msg) -> bool: ...
def toString(self) -> str: ...
class CommandResult:
def __repr__(self): ...
def toObject(self): ...
class NBT:
type: TagType
@staticmethod
def newByte(value: int) -> NBT: ...
@staticmethod
def newShort(value: int) -> NBT: ...
@staticmethod
def newInt(value: int) -> NBT: ...
@staticmethod
def newLong(value: int) -> NBT: ...
@staticmethod
def newFloat(value: float) -> NBT: ...
@staticmethod
def newDouble(value: float) -> NBT: ...
@staticmethod
def newByteArray(value: bytearray) -> NBT: ...
@staticmethod
def newString(value: str) -> NBT: ...
@staticmethod
def newIntArray() -> NBT: ...
@staticmethod
def newList() -> NBT: ...
@staticmethod
def newCompound() -> NBT: ...
@staticmethod
def fromSNBT(snbt: str) -> NBT: ...
@staticmethod
def fromBinary(bin: bytes) -> NBT: ...
def __getitem__(self, key) -> NBT: ...
def __setitem__(self, key, value): ...
def asByte(self) -> int: ...
def asShort(self) -> int: ...
def asInt(self) -> int: ...
def asInt64(self) -> int: ...
def asFloat(self) -> float: ...
def asDouble(self) -> float: ...
def asString(self) -> str: ...
def toBinary(self) -> bytes: ...
def toJson(self, indent=4) -> str: ...
def toSNBT(self, indent=4, format=SnbtFormat.PartialNewLine) -> str: ...
def append(self, value: NBT): ...
class Logger:
def __init__(self, title: str) -> None: ...
def debug(self, msg: str): ...
def info(self, msg: str): ...
def warn(self, msg: str): ...
def error(self, msg: str): ...
def fatal(self, msg: str): ...
def setTitle(self, title: str): ...
def setFile(self, file: str) -> bool: ...
def setPlayer(self, playe: Player) -> bool: ...
class Player:
name: str
pos: Vec3
blockpos: BlockPos
dim: int
real_name: str
xuid: str
uuid: str
perm_level: CommandPermissionLevel
game_mode: GameType
max_health: int
health: int
in_air: bool
in_water: bool
sneaking: bool
speed: float
direction: Vec2
unique_id: str
lang_code: str
ip: str
avg_ping: int
avg_packet_loss: int
os: str
clinet_id: str
def isOP(self) -> bool: ...
def setPermLevel(self, perm: CommandPermissionLevel) -> bool: ...
def setGameMode(self, mode: GameType) -> bool: ...
def runcmd(self, cmd) -> bool: ...
def teleport(self, pos, dim) -> bool: ...
def kill(self) -> bool: ...
def kick(self, msg) -> bool: ...
def sendText(self, msg, type=TextType.RAW) -> bool: ...
def talkAs(self, msg) -> bool: ...
def rename(self, name) -> bool: ...
def setOnFire(self, time: int) -> bool: ...
def transServer(self, ip: str, port=19132) -> bool: ...
def crash(self) -> bool: ...
def hurt(self, damage) -> bool: ...
def refreshChunks(self) -> bool: ...
def giveItem(self, item) -> bool: ...
def clearItem(self, type: str) -> bool: ...
def isSprinting(self) -> bool: ...
def setSprinting(self, value) -> bool: ...
def getBlockStandingOn(self) -> Block: ...
def getHand(self) -> Item: ...
def getOffHand(self) -> Item: ...
def getInventory(self) -> Container: ...
def getArmor(self) -> Container: ...
def getEnderChest(self) -> Container: ...
def getRespawnPosition(self) -> tuple[BlockPos, int]: ...
def setRespawnPosition(self, pos, dim) -> bool: ...
def refreshItems(self) -> bool: ...
def getScore(self, key) -> bool: ...
def setScore(self, key, value) -> bool: ...
def addScore(self, key, value) -> bool: ...
def reduceScore(self, key, value) -> bool: ...
def deleteScore(self, key) -> bool: ...
def setSidebar(
self, title, data: list[tuple[str, int]], order: ObjectiveSortOrder
) -> bool: ...
def removeSidebar(self) -> bool: ...
def setBossBar(self, uid, name, percent, colour: BossEventColour) -> bool: ...
def removeBossBar(self, uid=None) -> bool: ...
def addLevel(self, value) -> bool: ...
def getLevel(self) -> int: ...
def resetLevel(self) -> None: ...
def getXpNeededForNextLevel(self) -> int: ...
def addExperience(self, value) -> bool: ...
def sendSimpleForm(self, title, content, buttons, images, callback) -> bool: ...
def sendModalForm(self, title, content, button1, button2, callback) -> bool: ...
def sendCustomForm(self, str, callback) -> bool: ...
def setExtraData(self, key, value) -> bool: ...
def getExtraData(self, key) -> bool: ...
def delExtraData(self, key) -> bool: ...
def setNbt(self, nbt) -> bool: ...
def getNbt(self) -> NBT: ...
def addTag(self, tag: str) -> bool: ...
def removeTag(self, tag: str) -> bool: ...
def hasTag(self, tag: str) -> bool: ...
def getAllTags(self) -> list[str]: ...
def getEntityFromViewVector(self, max_distance=5.25) -> Entity: ...
def getBlockFromViewVector(
self,
includeLiquid=False,
solidOnly=False,
maxDistance=5.25,
ignoreBorderBlocks=True,
fullOnly=False,
) -> Block: ...
def removeItem(self, slot, num) -> bool: ...
def setHeadShow(self, text) -> bool: ...
# SimulatedPlayer API
def isSimulatedPlayer(self) -> bool: ...
def simulateSneak(self) -> bool: ...
def simulateAttack(self, target: Entity or None) -> bool: ...
def simulateDestory(self, face: ScriptFacing or None) -> bool: ...
def simulateDisconnect(self) -> bool: ...
def simulateInteract(self) -> bool: ...
def simulateInteractEntity(self, target: Entity) -> bool: ...
def simulateInteractBlock(self, pos, face: ScriptFacing) -> bool: ...
def simulateJump(self) -> bool: ...
def simulateLocalMove(self, target, speed=1.0) -> bool: ...
def simulateWorldMove(self, target, speed=1.0) -> bool: ...
def simulateMoveTo(self, target, speed=1.0) -> bool: ...
def simulateLookAt(self, target) -> bool: ...
def simulateSetBodyRotation(self, rotation: float) -> bool: ...
def simulateNavigateTo(
self, path_or_target: list[Vec3] or Entity or Vec3, speed=1.0
) -> bool: ...
def simulateUseItem(self) -> bool: ...
def simulateUseItem2(self, slot) -> bool: ...
def simulateUseItem3(self, item) -> bool: ...
def simulateUseItem4(
self, item, pos, face, relativePos=Vec3(0.5, 0.5, 0.5)
) -> bool: ...
def simulateUseItem5(
self, slot, pos, face, relativePos=Vec3(0.5, 0.5, 0.5)
) -> bool: ...
def simulateStopDestroyingBlock(self) -> bool: ...
def simulateStopInteracting(self) -> bool: ...
def simulateStopMoving(self) -> bool: ...
def simulateStopUsingItem(self) -> bool: ...
def simulateStopSneaking(self) -> bool: ...
class Entity:
name: str
type: str
id: str
pos: Vec3
blockpos: BlockPos
dim: int
max_health: int
health: int
in_air: bool
in_water: bool
speed: float
direction: Vec2
unique_id: str
def teleport(self, pos, dim) -> bool: ...
def kill(self) -> bool: ...
def hurt(self, damage) -> bool: ...
def setOnFire(self, value) -> bool: ...
def isPlayer(self) -> bool: ...
def toPlayer(self) -> Player: ...
def isItemEntity(self) -> bool: ...
def toItem(self) -> Item: ...
def getBlockStandingOn(self) -> Block: ...
def getArmor(self) -> Container: ...
def hasContainer(self) -> bool: ...
def getContainer(self) -> Container: ...
def refreshItems(self) -> bool: ...
def setNbt(self, nbt) -> bool: ...
def getNbt(self) -> NBT: ...
def addTag(self, tag) -> bool: ...
def removeTag(self, tag) -> bool: ...
def hasTag(self, tag) -> bool: ...
def getAllTags(self) -> list[str]: ...
def getEntityFromViewVector(self, max_distance=5.25) -> Entity: ...
def getBlockFromViewVector(
self,
includeLiquid=False,
solidOnly=False,
maxDistance=5.25,
ignoreBorderBlocks=True,
fullOnly=False,
) -> Block: ...
class BlockEntity:
pos: Vec3
type: str
def setNbt(self, nbt) -> bool: ...
def getNbt(self) -> NBT: ...
def getBlock(self) -> Block: ...
class Objective:
name: str
display_name: str
def setDisplay(self, slot: str, sort=0) -> bool: ...
def setScore(self, id, score) -> bool: ...
def addScore(self, id, score) -> bool: ...
def reduceScore(self, id, score) -> bool: ...
def deleteScore(self, id) -> bool: ...
def getScore(self, id) -> bool: ...
def getBbsVersion() -> str: ...
def getServerProtocolVersion() -> int: ...
def runCommand(cmd) -> bool: ...
def runCommandEx(cmd) -> tuple[str, bool]: ...
def setListener(event, callback: Callable[[dict[str, Any]], bool]) -> bool: ...
def registerCommand(
name,
desc,
callback: Callable[[Player, dict[str, CommandResult]], None],
perm=CommandPermissionLevel.GameMasters,
) -> bool: ...
def getPlayer(name) -> list[Player]: ...
def getOnlinePlayers() -> list[Player]: ...
def getAllEntities() -> list[Entity]: ...
def setServerMotd(motd: str) -> bool: ...
def broadcastText(text, type=TextType.RAW) -> bool: ...
def broadcastTitle(
text,
type=TitleType.SetTitle,
fade_in_duration=100,
remain_duration=500,
fade_out_duration=100,
) -> bool: ...
def getBlock(pos, dim) -> Block: ...
def setBlock(pos, dim, block: Block or str, tile_data=None) -> bool: ...
def getStructure(pos1, pos2, dim, ignore_entities=True, ignore_blocks=False) -> NBT: ...
def setStructure(nbt, pos, dim, mir=Mirror.None_15, rot=Rotation.None_14) -> None: ...
def explode(
pos, dim, power: float, destroy: bool, range: float, fire: bool
) -> None: ...
def spawnItem(item: Item, pos, dim) -> None: ...
def setSignBlockMessage(pos, dim, text) -> None: ...
def isSlimeChunk(x, z) -> bool: ...
def spawnMob(pos, dim, type) -> Entity: ...
def cloneMob(pos, dim, entity: Entity) -> Entity: ...
def spawnSimulatedPlayer(name, pos, dim) -> Player: ...
def spawnParticle(type, pos, dim) -> bool: ...
def setMotd(motd) -> bool: ...
def sendCmdOutput(output) -> bool: ...
def getDisplayObjective(slot) -> Objective: ...
def clearDisplayObjective(slot) -> Objective: ...
def getScoreObjective(name) -> Objective: ...
def newScoreObjective(name, display) -> Objective: ...
def removeScoreObjective(name) -> bool: ...
def getAllScoreObjectives() -> list[Objective]: ...
def setMaxPlayers(num) -> bool: ...
def getMoney(xuid) -> int: ...
def setMoney(xuid, num) -> bool: ...
def addMoney(xuid, num) -> bool: ...
def reduceMoney(xuid, num) -> bool: ...
def transMoney(xuid1, xuid2, num, notes) -> bool: ...
def getMoneyHistt(xuid, time) -> str: ...
def clearMoneyHistist(time) -> bool: ...