How do I make a enchant where if you kill someone, you get an item

Started by HollowVoidGojo on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a enchant where if you kill someone, you get an item

I am making an enchant where after 2 kills, you get an essence, how can I make it so that the enchant gives an item for every 2 kills that the player has? 

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create a PLAYER_PERSISTENT…
Sat, 06/04/2022 - 16:28

Create a PLAYER_PERSISTENT global number variable to track kills.

On entity killed trigger,:

     If player killed entity and has item with enchantment, increment counter.

     If counter => 2, drop item, reset counter to 0

 

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a Player…
Sat, 06/04/2022 - 23:05

How do I make a Player_Persistent global number? 

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Go to Variables Tab.
Sat, 06/04/2022 - 23:09

Go to Variables Tab.
img

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make it so that it…
Sat, 06/04/2022 - 23:12

How do I make it so that it has to be a player to be able to get the item not just a entity? 

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you could send me a…
Sat, 06/04/2022 - 23:13

If you could send me a ScreenShot of what the block code should look like, that would be wonderful 

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here, can you use this…
Sat, 06/04/2022 - 23:25

Here, can you use this. Things in red are important!
img

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thats great, is it possible…
Sun, 06/05/2022 - 07:35

Thats great, is it possible to make it so that this only happens when the enchantment is on the item? 

Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
or the enchantment is being…
Sun, 06/05/2022 - 07:35

or the enchantment is being used/the enchantment is on the item that is used to kill the player