Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wrap the monitor
- local monitor = peripheral.wrap("left") -- Adjust the side as needed
- -- Function to convert Minecraft time to a readable format
- function formatTime(minecraftTime)
- local hours = math.floor(minecraftTime / 1000 + 6) % 24
- local minutes = math.floor((minecraftTime % 1000) / 1000 * 60)
- return string.format("%02d:%02d", hours, minutes)
- end
- while true do
- -- Get the current Minecraft time
- local time = os.time()
- -- Clear the screen
- monitor.clear()
- monitor.setCursorPos(1, 1)
- -- Print the formatted time
- monitor.write("Current Time: " .. formatTime(time))
- -- Wait for a second before updating
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement