TypicalOperator

Fireball Boost - Breeze Client Script

Oct 10th, 2024 (edited)
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. name: FireballBoost
  3. author: Typx
  4. */
  5.  
  6. // Refactored by boredon
  7. import { breeze, inventory, mc, playerController } from '../breeze_defs';
  8.  
  9. function getItemSlot(itemID) {
  10.     for (slot=0; slot<8; slot++) {
  11.         var item = inventory.getStackInSlot(slot)
  12.         if (item && item.getItemId() == itemID) {
  13.             return slot
  14.         }
  15.     }
  16.     return null
  17. }
  18.  
  19. var sprintModule = breeze.getModule("Sprint");
  20. breeze.registerModule('Fireball Boost', 'Uses fireballs to boost your speed.', {
  21.     enable: function() {
  22.             var player = mc.getPlayer();
  23.             var sprintPreviouslyEnabled = sprintModule.enabled();
  24.             if (!sprintPreviouslyEnabled) {
  25.                 sprintModule.enable();
  26.             }
  27.        
  28.             previousSlot = inventory.currentSlot()
  29.             slot = getItemSlot(385);
  30.             if (!slot) {
  31.                 player = mc.getPlayer();
  32.                 breeze.postNotification("Fireball Boost", "You must have a fireball to use this module.");
  33.                 return;
  34.             }
  35.            
  36.             player.setSprinting(true);
  37.            
  38.             if (player.isSneaking()) {
  39.                 player = mc.getPlayer();
  40.                 breeze.postNotification("Fireball Boost", "Failed to Boost, you cannot sneak while using this module.");
  41.                 return;
  42.             }
  43.             if (player.getMotionX() === 0 && player.getMotionZ() === 0) {
  44.                 player = mc.getPlayer();
  45.                 breeze.postNotification("Fireball Boost", "Failed to Boost, you must be moving to use this module.");
  46.                 return;
  47.             }
  48.            
  49.            
  50.            
  51.             inventory.setCurrentSlot(slot);
  52.             player.setPitch(90);
  53.             playerController.sendUseItem();
  54.            
  55.             inventory.setCurrentSlot(previousSlot);
  56.             if (!sprintPreviouslyEnabled) {
  57.                 breeze.getModule("Sprint").disable();
  58.             }
  59.             breeze.getModule("Fireball Boost").disable();
  60.     }
  61. });
Advertisement
Add Comment
Please, Sign In to add comment