How can I make a pickaxe drop experience whenever it breaks any block?

Started by KarKomma404 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I make a pickaxe drop experience whenever it breaks any block?

Hello! I'm working on a little mod and I've created an Sculk Pickaxe. I came up with the idea of making it very easy to broke, but to gave you experience every time you use it. Not proceduraly, but every time you break a block. The issue is that I don't know how to program. Can somebody help me with the code? Thanks!

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry for my bad english, I…
Tue, 12/19/2023 - 00:52

Sorry for my bad english, I'm spanish

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
when block destroyed with…
Tue, 12/19/2023 - 01:44

when block destroyed with tool then give xp or spawn a xp orb
the trigger should be the 4th one in the mcreator triggers for the tool

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much
Tue, 12/19/2023 - 02:13

Thank you so much

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've encountered another…
Mon, 06/17/2024 - 14:38

I've encountered another problem. It doesn't matter what you break, it alwas gives you xp. For example, grass. Grass doesn't decrease the durability of the pickaxe, but gives you xp anyway. It gives you infinite xp. How can I make that the pickaxe only drops xp when a pickaxe exclusive block is broken? Like Stone, ores and so.

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
add a if statement inside…
Mon, 06/17/2024 - 19:20

add a if statement inside block is broken global trigger:

if block broken by _ tool

        if block broken is stone (or whatever. to add multiple just add a or block)

                    then drop _ amount of xp.

-PixelKid