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

Started by HollowVoidGojo on

Topic category: Help with modding (Java Edition)

Last seen on 02:09, 26. Sep 2022
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? 

Last seen on 05:05, 30. Oct 2022
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

 

Last seen on 02:09, 26. Sep 2022
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? 

Last seen on 15:51, 5. Mar 2024
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

Last seen on 02:09, 26. Sep 2022
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? 

Last seen on 02:09, 26. Sep 2022
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 

Last seen on 15:51, 5. Mar 2024
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

Last seen on 02:09, 26. Sep 2022
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? 

Last seen on 02:09, 26. Sep 2022
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