Jump to content

Make it so users can't crash servers while in creative


DeltaRays

Recommended Posts

A few days ago the connections event began and I developed a system to make it almost impossible for users to crash the server, here is the script we used if anyone needs it:

Note: It requires skBee for the NBT

The inventory click one sets the slot to air, although since it can only set it to air after one tick people would still be able to put items in hoppers or other inventories. That's why we also disabled opening inventories (excluding the player's inventory)

We did something similar to that for clicking.

We disabled pistons retracting because they could be used for lag machines, dispensing just in case a dangerous item managed to get into a dispenser, spawning entities and going to other dimensions.

31 July 2020

Added 'on swap hand items' as that can be spammed to crash servers (although I haven't tested whether or not it works)

on drop:
  cancel event

on inventory click:
  event-item is not a map or a player head item
  event-slot's nbt is not set:
    wait 1 tick
    length of event-slot's nbt > 6
    set event-slot to air
on inventory open:
  cancel event

on click:
  if length of nbt of player's tool > 4:
    player's tool is not a map or a player head item
    cancel event
    set player's tool's nbt to "{}"
  if length of (slot 40 of player's nbt) > 4:
    slot 40 of player is not a map or a player head item
    cancel event
    set (slot 40 of player)'s nbt to "{}"

    
on piston retract:
  cancel event

on dispense:
  cancel event


on spawn:
  cancel event

on portal:
  cancel event
  
on swap hand items:
  set metadata value "swaps" of player to 0 if metadata value "swaps" of player is not set
  add 1 to metadata value "swaps" of player
  if metadata value "swaps" of player > 3:
    cancel event
  else if metadata value "swaps" of player is 1:
    wait 5 seconds
    set metadata value "swaps" of player to 0

 

Edited by DeltaRays
Updated to add 'on swap hand items'
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Im curious can you set a NBT spawn egg back to a vanilla spawn egg with skript? I cant find anything about it anywhere as i know more crashes than this.

Start your Minecraft server today for as low as £0.50/weekly for up to 4 GB of RAM! (£3.50 Monthly) and be equipped for all situations with our high-performance gear keeping your servers running 24/7

Why choose Us?
• Guaranteed 99.9% Uptime
• NVMe RAID Fast Storage
• 24/7 Hosting
• Instant Setup
• 50% Discount. Use Code: 50OFF (Ends on November 11th)

We want to ensure our customers are happy with the service they received and support. We aim to provide low-costs those who cant afford a minecraft server. No extra costs, no setup fees! One-time payment and you are good to go with our instant setup feature we introduced to ensure your server is ready to go!

Planning to make a community or a project you want to work on? We got you covered! Our servers are optimized for performance and security, so you can have peace of mind and focus on your project. Our servers are also reliable and packed with features, so you can start playing right away.

We guarantee 99% uptime and 24/7 customer support, so you can always ask for help if you need it.

Links:
https://forums.valknet.org
https://billing.valknet.org
Invite: https://discord.gg/FqSRt4ZCAC

Link to comment
Share on other sites

cool stuff

Graphic Designer - Skript Developer - Professional Builder - Content Creator

Been on Minehut since January 2018. Throughout my time here I've mastered the skills you see above. I make free logos, banners, and server art for users on Minehut. I'm a proficient Skript developer. I'm also really good at building, you can see my portfolio by clicking here. Feel free to say hi if you see me somewhere 🙂

Amethyst Studios Discord

Link to comment
Share on other sites

😄

On 7/30/2020 at 2:54 AM, TacticalModz said:

Im curious can you set a NBT spawn egg back to a vanilla spawn egg with skript? I cant find anything about it anywhere as i know more crashes than this.

I haven't looked into it but you probably could just set the nbt to {}

Link to comment
Share on other sites

1 hour ago, DeltaRays said:

😄

I haven't looked into it but you probably could just set the nbt to {}

hmm alright cheers!

Start your Minecraft server today for as low as £0.50/weekly for up to 4 GB of RAM! (£3.50 Monthly) and be equipped for all situations with our high-performance gear keeping your servers running 24/7

Why choose Us?
• Guaranteed 99.9% Uptime
• NVMe RAID Fast Storage
• 24/7 Hosting
• Instant Setup
• 50% Discount. Use Code: 50OFF (Ends on November 11th)

We want to ensure our customers are happy with the service they received and support. We aim to provide low-costs those who cant afford a minecraft server. No extra costs, no setup fees! One-time payment and you are good to go with our instant setup feature we introduced to ensure your server is ready to go!

Planning to make a community or a project you want to work on? We got you covered! Our servers are optimized for performance and security, so you can have peace of mind and focus on your project. Our servers are also reliable and packed with features, so you can start playing right away.

We guarantee 99% uptime and 24/7 customer support, so you can always ask for help if you need it.

Links:
https://forums.valknet.org
https://billing.valknet.org
Invite: https://discord.gg/FqSRt4ZCAC

Link to comment
Share on other sites

On 7/30/2020 at 5:46 PM, chillins said:

This looks epic

big epic

Graphic Designer - Skript Developer - Professional Builder - Content Creator

Been on Minehut since January 2018. Throughout my time here I've mastered the skills you see above. I make free logos, banners, and server art for users on Minehut. I'm a proficient Skript developer. I'm also really good at building, you can see my portfolio by clicking here. Feel free to say hi if you see me somewhere 🙂

Amethyst Studios Discord

Link to comment
Share on other sites

On 7/31/2020 at 12:38 PM, DeltaRays said:

😄

I haven't looked into it but you probably could just set the nbt to {}

ay delta! long time no see

anyways it'll be cool to add 

 

on drop:

 send "&6&l[Servername] You can't drop that."

cancel event

 

Or something like that.

tyty.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...