How to make a global procedure "use loot.table if killed by player" ?

Started by Silverlion on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a global procedure "use loot.table if killed by player" ?

Hello, all I want to do is to set up a global rule, that Mobs / entitites only drop loot according to their respective loot tables, when they are killed by a player (global anti-auto-farm control).

I managed to make a procedure, that a mob only drops an item, if it is "killed by player". But I don't know how to link to the corresponding loot.table at the "DO"-part, I just managed to give fixed items for test purposes with "Spawn item/gem".

So how to activate the respective loot.table of the mob ?  Or do I have to edit ALL loot tables and need to add a "condition: killed_by_player" ?  That's something I'd like to avoid...

Thanks for hints !

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can use this if you're…
Sun, 09/10/2023 - 12:37

You can use this if you're using last versinon (2023.3)

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey, thanks so far !  Tried…
Sun, 09/10/2023 - 16:06

Hey,

thanks so far !  Tried to copy it to 1.19.2, but I can't find the "is <> of type" and "provided damage source". 

Have only found "is <> sub type of <>" . Is this the same ? Or are these blocks new to 2023.3 ?

Cheers

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also didn't find the …
Sun, 09/10/2023 - 16:10

also didn't find the "provided damage source" ? Do I need to install the plugin "Additions" for define that variable ?

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm using "Damage Procedures…
Sun, 09/10/2023 - 16:14

I'm using "Damage Procedures" and "Attributes" plugins. I'm sorry I forgetted to add. and yes 2023.3 version added damage source.

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
only when killed a by player…
Sun, 09/10/2023 - 17:09

only when killed a by player? Alright here:

 

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Although the loot table…
Sun, 09/10/2023 - 17:56

Although the loot table might need to be renamed for that one since if its identical it will drop either way..

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@XenraO : ok, just installed…
Sun, 09/10/2023 - 19:09

@XenraO :

ok, just installed 2023.3 and managed to re-do your solution - check

Now I try to translate your procedure to 2023.2 (1.19.2), but get lost completely - sorry.

I added the plugin "Addition" and see its new proc.blocks, but I don't have any clue how to fill the variables:

https://photos.app.goo.gl/QNtyA3UpzM5EK8WH8

(I even don't get that f..&%$§%$ picture link working although I do it like in that tutorial)

Is there any wiki where this whole graphical editor and its contents is explained ?? I don't get acquainted to the system, sometimes there is a variable already, sometimes it is not... don't get the system behind.

 

@ McModded1.14 :

wow, thanks for that solution ! The only thing is, that I'd liked to have a generic procedure that's working for all mobs at once:

"IF  killed_by_player -> use the respective (mostly vanilla) loot table ; ELSE  do nothing / quit"

With your solution I'd have to add every single mob of the game to the procedure, so that it's applied to every creature.

 

sorry, just really frustrated after 3 hours of trying and searching for tuts / wikis and achieving nothing.  :(

But thanks both of you for your help so far !

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Alr I'll try to have one…
Sun, 09/10/2023 - 19:13

Alr I'll try to have one ready in a couple mins

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1: make an entity tag that…
Sun, 09/10/2023 - 19:32

1: make an entity tag that contains mobs from your mod.

2: make an entity loot table: (entity id without the mod id)_loot

3: Procedure would be something like this:


 

Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks a lot both of you !!…
Sat, 09/16/2023 - 18:36

thanks a lot both of you !!

I'll make up my mind what direction my mod shall go and might come back to your solutions then.

Thx !!!