How to get a player_persistent variable block

Started by thomas2 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to get a player_persistent variable block

I am new to this and trying to make a simple sword that deals a lot of dmg every 5 hits. I tought the best way to do it is to create a player_persistent variable and add 1 to it each time the player attack an entity with the sword. When the variable is at 5, the entity receive extra dmg and the variable reset. The problem is: I dont know where to find blocks that does this. In fact, i cant even find a block that allows me to put a player_persistent variable. 

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you can't declare a player…
Tue, 06/17/2025 - 16:04

you can't declare a player_persistent variable in procedures, you need to go to the "Variables" tab of MCreator, then after declaring it there you can get and edit its value in procedures using the blocks in the "custom variables" section

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I did make the variable like…
Tue, 06/17/2025 - 19:01

I did make the variable like that, but it doesnt shows up when i do the procedure.