Minecraft Classic Block Color Changer

Change the colors of blocks in Minecraft Classic

  1. // ==UserScript==
  2. // @name Minecraft Classic Block Color Changer
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Change the colors of blocks in Minecraft Classic
  6. // @author You
  7. // @match https://classic.minecraft.net/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Define your block color changes here
  15. const blockColors = {
  16. 'block-id-1': '#ff0000', // Replace 'block-id-1' with actual block ID and color
  17. 'block-id-2': '#00ff00', // Replace 'block-id-2' with actual block ID and color
  18. // Add more blocks and colors as needed
  19. };
  20.  
  21. // Function to change block colors
  22. function changeBlockColors() {
  23. Object.keys(blockColors).forEach(blockId => {
  24. const elements = document.querySelectorAll(`.block-class-${blockId}`); // Adjust selector as needed
  25. elements.forEach(element => {
  26. element.style.backgroundColor = blockColors[blockId];
  27. });
  28. });
  29. }
  30.  
  31. // Run the function when the page loads
  32. window.addEventListener('load', changeBlockColors);
  33. })();