Help trying to see whats missing

Started by Leilak on

Topic category: Help with modding (Java Edition)

Last seen on 06:02, 18. Jan 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help trying to see whats missing

im REALLY new to programming, so i wanted help with this, im trying to make an enchantment that makes that when i kill a mob, i win certain levels of xp, can someone help me with this? i know its dumb but i really cant do it

Last seen on 18:06, 24. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When you make a procedure,…
Fri, 12/29/2023 - 14:13

When you make a procedure, you need to make sure it has the correct dependencies. Dependencies are things that are provided by the trigger you use, that can be used in your procedure. 

The dependency for 'when an entity dies' does not provide an itemstack. (It wouldn't know where to get it from.) It only provides 'entity,' 'source entity,' 'x/y/z,' and 'world' as a dependency, so these are the only external things you're allowed to reference for that trigger. But since you can reference 'source entity,' (The entity who killed the target entity, who died), you can replace 'provided itemstack' with 'item in main hand of source entity,' and this should work as intended. (There's an 'item in main hand of entity' function in entity management, but it uses the target entity by default. You need to replace it with source entity so it checks the main hand of the entity who killed, not the one who died.)

I recommend NorthWestTrees Gaming; it's a youtube channel that's a great reference for new modders! I often find it's easier to learn by watching someone else work through a process than just reading about it...