Skip to content
The Chat Archive
gpt-3.5-turbo-0613· OpenAI WildChat-4.8M (AI2)

can you code a skript that when that player place a spawner near another spawner, it…

  1. User

    can you code a skript that when that player place a spawner near another spawner, it will merge together and when they sneak and place near that spawners it will take all the spawner type of that player placed and merge together. and another one when they break the spawner while shifting allowed them to get the original amount of the spawner they placed

  2. Assistant

    Yes, I can help you with that! You can achieve this using the Skript plugin for Bukkit or Spigot servers. Here's the code you can use to implement the functionality you described:

    on place of mob spawner:
        if {placed.%player%} is not set: # If player has not placed any spawner before
            set {placed.%player%} to 1 # Initialize the count to 1
        else:
            set {placed.%player%} to {placed.%player%} + 1 # Increment the count by 1
        set {spawner.%player%.%x%_%y%_%z%} to type of clicked block # Store the type of the spawner at x, y, z coordinates
        
    on place of mob spawner: # When placing a new spawner
        loop all players:
            if loop-player is within 2 blocks of event-player: # Check if the current player is within 2 blocks of the event player
                set {_types::*} to loop-player's {spawner.*} # Get all spawner types placed by the current player
                set {_mergedTypes::*} to {} # Initialize an empty list for merged spawner types
                loop {_types::*}: # Loop through each spawner type
                    add loop-value to {_mergedTypes::*} # Add the current spawner type to the merged list
                set loop-player's {spawner.*} to {_mergedTypes::*} # Update the current player's spawner types
                
    on break of mob spawner (while sneaking):
        if event-block is mob spawner: # Check if the broken block is a spawner
            set {spawnerType} to "null" # Initialize spawnerType as null
            loop all players:
                if loop-player is within 2 blocks of event-player: # Check if the current player is within 2 blocks of the event player
                    if loop-player's {spawner.%event-block.xyz%} is not set: # If the player has not placed a spawner at the same location before
                        continue # Skip to the next player
                    set {spawnerType} to loop-player's {spawner.%event-block.xyz%} # Store the spawner type into spawnerType variable
                    remove event-block # Remove the broken spawner
                    remove loop-player's {spawner.%event-block.xyz%} # Remove the stored spawner type
                    break # Exit the loop
                    
            if {spawnerType} is not "null": # If a spawner type is found
                give event-player {spawnerType} spawner 1 # Give the player the original spawner they placed
    

    Make sure to install the Skript plugin and put this code in a Skript file (.sk) in the plugins/Skript/scripts/ folder on your server. This code tracks the number and type of spawners placed by each player and merges the types when placing near each other or breaking a spawner while sneaking.

  3. User

    Can you code a skript that like the minecraft server DonutSMP

  4. Assistant

    Certainly! However, without more specific details about what features you would like to replicate from the DonutSMP server, I can provide you with a basic Skript setup commonly found on Minecraft SMP servers. You can add or modify specific functionalities as needed. Here's a simple example to get you started:

    # Variables
    variables:
      {_prefix} = "&7[&eDonutSMP&7] "
      {_spawnLocation} = location(0.5, 64, 0.5) # Set the spawn location to (x=0.5, y=64, z=0.5)
    
    # Starting message
    on server start:
      broadcast {_prefix} &aWelcome to DonutSMP!
      teleport all players to {_spawnLocation}
      give all players stone pickaxe 1
    
    # Player join message
    on join:
      send "{_prefix} &aWelcome to the server, %player%! Enjoy your time on DonutSMP."
    
    # Player quit message
    on quit:
      send "{_prefix} &cGoodbye, %player%! We hope to see you again on DonutSMP."
    
    # Set time to day when a player sleeps in a bed
    on bed enter:
      if time is night:
        set time to day for the world
    
    # Custom command: /spawn
    command /spawn:
      trigger:
        teleport player to {_spawnLocation}
        send "{_prefix} &aTeleported to spawn."
    
    # Custom command: /home
    command /home:
      triggers:
        cooldown: 10 seconds
      permissions:
        - homes.use
      trigger:
        # Check if the player has set a home already
        if {home.%player%} is set:
          teleport player to {home.%player%}
          send "{_prefix} &aTeleported to your home."
        else:
          send "{_prefix} &cYou haven't set a home yet. Use /sethome to set your home location."
    
    # Custom command: /sethome
    command /sethome:
      permissions:
        - homes.set
      trigger:
        set {home.%player%} to player's location
        send "{_prefix} &aHome location set."
    
    # Custom command: /tpa <player>
    command /tpa [<offlineplayer>]:
      aliases: /teleportask
      permissions:
        - teleport.ask
      trigger:
        if {args.0} is set:
          set {_target} to {_arg-1}
          send "{_prefix} &aSent teleport request to %{_target}%."
          send "{_prefix} &e%player% &awants to teleport to you. Use /tpaccept or /tpdeny."
          set {_target}'s {teleport.request} to player
        else:
          send "{_prefix} &cYou must specify a player to send a teleport request."
    
    # Custom command: /tpaccept
    command /tpaccept:
      permissions:
        - teleport.respond
      trigger:
        if {teleport.request} is set:
          teleport player to {teleport.request}
          send "{_prefix} &aTeleported to %player%."
          remove {teleport.request}
        else:
          send "{_prefix} &cYou have no pending teleport requests."
    
    # Custom command: /tpdeny
    command /tpdeny:
      permissions:
        - teleport.respond
      trigger:
        if {teleport.request} is set:
          send "{_prefix} &cYou denied the teleport request from %player%."
          remove {teleport.request}
        else:
          send "{_prefix} &cYou have no pending teleport requests."
    

    Make sure to install the Skript plugin and place this code in a Skript file (.sk) in the plugins/Skript/scripts/ folder on your server. Adjust the code based on your specific preferences and server setup.

  5. User

    Can you code a spawner skript that like the plugin in DonutSMP

  6. Assistant

    Certainly! Here's an example of a Skript that adds functionality similar to the spawner plugin used in DonutSMP:

    # Variables
    variables:
      {_spawnerTypes::*} # Stores all available spawner types
    
    # Player place spawner
    on place of mob spawner:
      if loop-player has permission "donutsmp.spawner.place": # Check if the player has permission to place spawners
        loop {_spawnerTypes::*}: # Loop through each spawner type
          if name of clicked block is spawner and name of loop-value is name of clicked item: # Check if the spawner type matches the item in hand
            set name of clicked block to loop-value # Set the spawner type of the placed spawner
            cancel event # Cancel the default spawner placement behavior
            break # Exit the loop
    
    # Player break spawner
    on break of mob spawner:
      if loop-player has permission "donutsmp.spawner.break": # Check if the player has permission to break spawners
        loop {_spawnerTypes::*}: # Loop through each spawner type
          if name of clicked block is loop-value: # Check if the spawner type matches the clicked block
            loop-player increase 1 spawner type of loop-value # Give the player the corresponding spawner item
            break # Exit the loop
    
    # Spawner item crafting
    on craft of [diamond | iron | gold | redstone] <<type: item>>:
      if {_spawnerTypes::*} contains name of event-item: # Check if the crafted item is a spawner type
        loop-player increase 1 spawner type of name of event-item # Give the player one of the corresponding spawner items
    
    # Spawner item smelting
    on smelt of [diamond | iron | gold | redstone] <<type: item>>:
      if {_spawnerTypes::*} contains name of event-item: # Check if the smelted item is a spawner type
        loop-player increase 1 spawner type of name of event-item # Give the player one of the corresponding spawner items
    
    # Spawner item fishing
    on fishing:
      set {_randomSpawner} to random spawner in {_spawnerTypes::*} # Choose a random spawner type
      give caught item to loop-player # Give the player the caught item
      loop-player increase 1 spawner type of {_randomSpawner} # Give the player one of the corresponding spawner items
    

    This Skript assumes that you have already set up a list of available spawner types in the {_spawnerTypes::*} variable. The spawner types should have the same names as the items you want to use for spawner placement. Adjust the permission nodes ("donutsmp.spawner.place" and "donutsmp.spawner.break") to match your server's permission system.

    Install the Skript plugin and put this code in a Skript file (.sk) in the plugins/Skript/scripts/ folder on your server. Modify the code to fit your specific spawner types and server configuration.

  7. User

    Make a lookalike donutsmp /rtp skript

  8. Assistant

    Sure! Here's an example Skript to create a /rtp command similar to the one in DonutSMP. The /rtp command will teleport the player to a random location within a specified radius:

    # Variables
    variables:
      {_rtpRadius} = 500 # Set the radius for the /rtp command (in blocks)
    
    # Custom command: /rtp
    command /rtp:
      aliases: /randomtp
      trigger:
        if loop-player has permission "donutsmp.rtp": # Check if the player has permission to use /rtp
          set {_minX} to (player's x - {_rtpRadius})
          set {_minZ} to (player's z - {_rtpRadius})
          set {_maxX} to (player's x + {_rtpRadius})
          set {_maxZ} to (player's z + {_rtpRadius})
    
          set {_safeLocation} to random location between {_minX}, {_minZ}, {_maxX}, {_maxZ} on world
          set {_tpLocation} to {_safeLocation}
          loop 10 times:
            if {_tpLocation} is unsafe: # Check if the teleport location is unsafe
              set {_safeLocation} to random location between {_minX}, {_minZ}, {_maxX}, {_maxZ} on world
              set {_tpLocation} to {_safeLocation}
            else:
              break # Exit the loop if a safe teleport location is found
    
          teleport player to {_tpLocation}
          send "&eYou have been randomly teleported."
        else:
          send "&cYou do not have permission to use /rtp."
    
    # Location safety check
    on event teleport:
      if player's world is overworld:
        if player's y < 65:
          send "&cYou have been teleported to an unsafe location."
    

    Install the Skript plugin and place this code in a Skript file (.sk) in the plugins/Skript/scripts/ folder on your server. Adjust the permission node ("donutsmp.rtp") to match your server's permission system. You can also modify the radius by changing the value in the {_rtpRadius} variable. The Skript will teleport the player to a random location within the specified radius on the overworld, while checking for safety by ensuring the player is above y-level 65.

  9. User

    Make a skript that when player execute the command /rtp or /randomtp it will open a menu with the size of 3 rows chest and in the middle it will have Netherrack block that when the player click it it will make the player execute the command: /rtp world world_nether and another slot 2 it will be grassblock and when the player click it will make the player execute command /rtp world world and last one in the slot 4 it a endstone and when the player clicked it will make the player execute command: /rtp word_the_end

  10. Assistant

    Sure! Here's an example Skript that opens a menu when the player uses the /rtp or /randomtp command. The menu contains different blocks that, when clicked, execute the corresponding teleportation commands:

    # Custom command: /rtp or /randomtp
    command /rtp:
      aliases: /randomtp
      trigger:
        if loop-player has permission "donutsmp.rtp": # Check if the player has permission to use /rtp
          open virtual chest inventory with size 27 named "&8Teleportation Menu": # Open a virtual chest inventory menu
            loop 27 times:
              set slot loop-number of chest inventory to air
            set slot 13 of chest inventory to netherrack named "&cGo to Nether" # Set the middle slot to a netherrack block
            set slot 20 of chest inventory to grass_block named "&aGo to Overworld" # Set slot 2 to a grass block
            set slot 24 of chest inventory to end_stone named "&dGo to End" # Set slot 4 to an end stone
    
    # Handle chest inventory click event
    on inventory click:
      if event-inventory is chest inventory named "&8Teleportation Menu":
        cancel event
        if clicked item is air:
          stop # Exit if an empty slot is clicked
    
        if name of clicked item is "&cGo to Nether": # Check if netherrack block is clicked
          execute console command "rtp world world_nether" # Execute the /rtp command to teleport to the Nether
          close the inventory # Close the menu
        else if name of clicked item is "&aGo to Overworld": # Check if grass block is clicked
          execute console command "rtp world world" # Execute the /rtp command to teleport to the overworld
          close the inventory # Close the menu
        else if name of clicked item is "&dGo to End": # Check if end stone is clicked
          execute console command "rtp world_the_end" # Execute the /rtp command to teleport to The End
          close the inventory # Close the menu
    

    Install the Skript plugin and place this code in a Skript file (.sk) in the plugins/Skript/scripts/ folder on your server. Adjust the permission node ("donutsmp.rtp") to match your server's permission system. When the player uses the /rtp or /randomtp command, a menu with a 3-row chest will open. The menu contains a netherrack block in the middle slot, a grass block in slot 2, and an end stone in slot 4. Clicking on these blocks executes the respective teleportation commands.

  11. User

    code a skript that when player execute the command: /home it will open the menu like donutsmp with clickable home deletion and creation with the teleportation system

  12. Assistant

    Sure! Here's an example Skript that opens a home menu when the player uses the /home command. The menu allows the player to create and delete homes and teleport to their existing homes:

    # Custom command: /home
    command /home:
      trigger:
        open virtual chest inventory with size 54 named "&8Home Menu": # Open a virtual chest inventory menu
          loop 54 times:
            set slot loop-number of chest inventory to air
          set slot 53 of chest inventory to barrier named "&cBack" # Set the last slot to a barrier (Back button)
          execute console command "homes list" # Execute the "homes list" command to get a list of the player's homes
    
    # Handle chest inventory click event
    on inventory click:
      if event-inventory is chest inventory named "&8Home Menu":
        cancel event
        if clicked item is air:
          stop # Exit if an empty slot is clicked
    
        if name of clicked item is "&cBack" and loop-player has permission "donutsmp.home.back": # Check if the Back button is clicked
          close the inventory # Close the menu and go back to the previous menu or action
    
        execute console command "homes list" # Execute the "homes list" command again to refresh the list of the player's homes
    
        if name of clicked item starts with "&aHome ": # Check if a home item is clicked
          set {_homeName} to name of clicked item without "&aHome " # Extract the home name from the clicked item's name
          if {_homeName} is "Create New Home": # Check if the Create New Home button is clicked
            execute console command "homes create" # Execute the "homes create" command to create a new home
            close the inventory # Close the menu
          else if {_homeName} is "Delete Home": # Check if the Delete Home button is clicked
            if loop-player has permission "donutsmp.home.delete": # Check if the player has permission to delete homes
              execute console command "homes delete {_homeName}" # Execute the "homes delete" command with the selected home name
              close the inventory # Close the menu
            else:
              send "&cYou do not have permission to delete homes."
          else: # Regular home teleportation
            execute console command "homes teleport {_homeName}" # Execute the "homes teleport" command with the selected home name
            close the inventory # Close the menu
    

    Install the Skript plugin and place this code in a Skript file (.sk) in the plugins/Skript/scripts/ folder on your server. Adjust the permission node ("donutsmp.home.back" and "donutsmp.home.delete") to match your server's permission system. When the player uses the /home