mcapibridge 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcapibridge
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Python libary for MCAPIBridge
5
5
  Author: TaotianZhufang
6
6
  License: MIT License
@@ -127,6 +127,24 @@ Sets the text on a sign block.
127
127
 
128
128
  **The block at the position must already be a sign.**
129
129
 
130
+ #### `lookAt(target, x, y, z)`
131
+ Forces a player or entity to look at a specific coordinate.
132
+ * **target**: String player name or Entity ID.
133
+ * **x, y, z**: The coordinate to look at.
134
+ * *Example*: `mc.lookAt("Steve", 0, 100, 0)` forces Steve to look up.
135
+
136
+ #### `setEntityNbt(entity_id, nbt_string)`
137
+ Modifies the NBT data of an entity directly using JSON format.
138
+ * **entity_id**: Integer Entity ID.
139
+ * **nbt_string**: Valid SNBT string (e.g., `"{NoAI:1b, Glowing:1b}"`).
140
+ * *Note*: Useful for setting attributes like Scale in 1.20.6 (`{Attributes:[{Name:"generic.scale",Base:2.0d}]}`).
141
+
142
+ #### `setBlockNbt(x, y, z, nbt_string, dimension=None)`
143
+ Modifies the NBT data of a block entity (Tile Entity).
144
+ * **x, y, z**: Integer coordinates.
145
+ * **nbt_string**: Valid SNBT string.
146
+
147
+
130
148
  ---
131
149
 
132
150
  ### Info
@@ -95,6 +95,24 @@ Sets the text on a sign block.
95
95
 
96
96
  **The block at the position must already be a sign.**
97
97
 
98
+ #### `lookAt(target, x, y, z)`
99
+ Forces a player or entity to look at a specific coordinate.
100
+ * **target**: String player name or Entity ID.
101
+ * **x, y, z**: The coordinate to look at.
102
+ * *Example*: `mc.lookAt("Steve", 0, 100, 0)` forces Steve to look up.
103
+
104
+ #### `setEntityNbt(entity_id, nbt_string)`
105
+ Modifies the NBT data of an entity directly using JSON format.
106
+ * **entity_id**: Integer Entity ID.
107
+ * **nbt_string**: Valid SNBT string (e.g., `"{NoAI:1b, Glowing:1b}"`).
108
+ * *Note*: Useful for setting attributes like Scale in 1.20.6 (`{Attributes:[{Name:"generic.scale",Base:2.0d}]}`).
109
+
110
+ #### `setBlockNbt(x, y, z, nbt_string, dimension=None)`
111
+ Modifies the NBT data of a block entity (Tile Entity).
112
+ * **x, y, z**: Integer coordinates.
113
+ * **nbt_string**: Valid SNBT string.
114
+
115
+
98
116
  ---
99
117
 
100
118
  ### Info
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mcapibridge"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Python libary for MCAPIBridge"
9
9
  requires-python = ">=3.7"
10
10
  license = { file = "LICENSE" }
@@ -342,3 +342,14 @@ class Minecraft:
342
342
  cmd = f"world.setSign({int(x)},{int(y)},{int(z)},{l1},{l2},{l3},{l4})"
343
343
  if dimension: cmd += f",{dimension}"
344
344
  self._send(cmd)
345
+
346
+ def lookAt(self, target, x, y, z):
347
+ self._send(f"player.lookAt({target},{x},{y},{z})")
348
+
349
+ def setEntityNbt(self, entity_id, nbt_string):
350
+ self._send(f"entity.setNbt({entity_id},{nbt_string})")
351
+
352
+ def setBlockNbt(self, x, y, z, nbt_string, dimension=None):
353
+ cmd = f"block.setNbt({int(x)},{int(y)},{int(z)},{nbt_string})"
354
+ if dimension: cmd += f",{dimension}"
355
+ self._send(cmd)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcapibridge
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Python libary for MCAPIBridge
5
5
  Author: TaotianZhufang
6
6
  License: MIT License
@@ -127,6 +127,24 @@ Sets the text on a sign block.
127
127
 
128
128
  **The block at the position must already be a sign.**
129
129
 
130
+ #### `lookAt(target, x, y, z)`
131
+ Forces a player or entity to look at a specific coordinate.
132
+ * **target**: String player name or Entity ID.
133
+ * **x, y, z**: The coordinate to look at.
134
+ * *Example*: `mc.lookAt("Steve", 0, 100, 0)` forces Steve to look up.
135
+
136
+ #### `setEntityNbt(entity_id, nbt_string)`
137
+ Modifies the NBT data of an entity directly using JSON format.
138
+ * **entity_id**: Integer Entity ID.
139
+ * **nbt_string**: Valid SNBT string (e.g., `"{NoAI:1b, Glowing:1b}"`).
140
+ * *Note*: Useful for setting attributes like Scale in 1.20.6 (`{Attributes:[{Name:"generic.scale",Base:2.0d}]}`).
141
+
142
+ #### `setBlockNbt(x, y, z, nbt_string, dimension=None)`
143
+ Modifies the NBT data of a block entity (Tile Entity).
144
+ * **x, y, z**: Integer coordinates.
145
+ * **nbt_string**: Valid SNBT string.
146
+
147
+
130
148
  ---
131
149
 
132
150
  ### Info
File without changes
File without changes