Minecraft AFK-bot with Python! #programming #python #coding #tutorial #minecraft

preview_player
Показать описание
Minecraft Automation with Python! #programming #python #coding #tutorial #minecraft
Рекомендации по теме
Комментарии
Автор

from ursina import *
from import FirstPersonController

class Voxel(Button):
def __init__(self, position=(0, 0, 0)):
super().__init__(
parent=scene,
position=position,
model='cube',
origin_y=0.5,
texture='white_cube',
color=color.white,
highlight_color=color.lime,
collider='box' # Add collider to the voxel
)

def input(self, key):
if self.hovered:
if key == 'left mouse down':
Voxel(position=self.position + mouse.normal)
elif key == 'right mouse down':
destroy(self)

def update():
if held_keys['escape']:
mouse.locked = not mouse.locked
if mouse.locked:
mouse.visible = False
else:
mouse.visible = True

# Movement controls using arrow keys
if held_keys['up arrow']:
player.position += player.forward * time.dt * 5
if held_keys['down arrow']:
player.position -= player.forward * time.dt * 5
if held_keys['left arrow']:
player.position -= player.right * time.dt * 5
if held_keys['right arrow']:
player.position += player.right * time.dt * 5

app = Ursina()

# Create a grid of voxels
for z in range(8):
for x in range(8):
voxel = Voxel(position=(x, 0, z))

player = FirstPersonController()
player.collider = 'box' # Add collider to the player

app.run()

SaranshmanojSingh