How to make mobs drop items randomly

Started by Clint42 on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 week ago
Joined Jan 2024
Points:
112

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
How to make mobs drop items randomly

How can I make a mob drop items randomly - similarly to the armadillo dropping scutes - in a non-laggy way?

Active 8 months ago
Joined Apr 2024
Points:
94

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 14
when entity dies: if random…
Tue, 08/13/2024 - 13:47

when entity dies: 
if random integer between 1 and 10 == 1:
spawn dropped item at x y z of target entity

Active 1 week ago
Joined Jan 2024
Points:
112

User statistics:

  • Modifications: 1
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
I don't want it to drop it…
Tue, 08/13/2024 - 15:01

I don't want it to drop it when it dies, but I want it to drop it when it is idle. Kind of like when a chicken dropping an egg.

Active 8 months ago
Joined Apr 2024
Points:
94

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 14
maybe use random on entity…
Wed, 08/14/2024 - 10:45

maybe use random on entity update tick?