Prevent cracked accounts from using your mod

Started by _Rewe on

Topic category: User side tutorials

Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Prevent cracked accounts from using your mod
Wed, 11/02/2022 - 20:12 (edited)

Do you don't want to support cracked accounts? Then this tutorial is for you. It simply prevents cracked users from joining any world or server by immediately kicking them with an error message. Accounts are checked using mojangs official session server api. This system excludes the MCreator test account.

Warning: This makes your mod at least partially internet-dependent (internet is required on join to check if the account is premium), but this shouldn't be a bug problem since almost everyone has unlimited internet.

Tutorial

  1. Create a global variable with the following properties:

    Name    ValidAccount
    Type    logic
    Scope    PLAYER_LIFETIME

     

  2. Create a new procedure, save it and lock it
  3. Replace the code completely with the code found here: https://dpaste.org/xmRXV
  4. Replace package paths/names that are from my mod (anything with rewe or NotEnoughPotions) with paths/names from your mod
  5. You can replace the message of the kick commands in line 91 and 122 with a custom message for your mod or change the commands entirely.

Thats it! Now only legit users should be able to use your mod!

Edited by _Rewe on Wed, 11/02/2022 - 20:12
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If anything this makes…
Sat, 11/05/2022 - 12:24

If anything this makes people not wanna use your mod. Also won't take long for someone to work around this.


 

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Offline play are a still a…
Sun, 11/06/2022 - 06:42

Offline play are a still a big part of MC, mod packs what are sessioned in don't need to be online and will work fine offline and on the go, doing this will make people think something is broken.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also if your like me and…
Sun, 11/06/2022 - 06:44

Also if your like me and change dev name you would have to also edit this part
 

if ((entity.getDisplayName().getString()).equals("Dev")) {
					if (entity instanceof Player _player && !_player.level.isClientSide())
						_player.displayClientMessage(new TextComponent("\u00A76Logged in as MCreator developer account."), (false));
This is probably the most…
Sun, 11/06/2022 - 06:54

This is probably the most counter-productive thing you could do. Piracy, believe it or not, is a big part of Minecraft and was even supported by Notch. Hell, It was what first got me into Minecraft!