1
0
mirror of https://github.com/TechnoVisionDev/Forge-Modding-Tutorial-1.16 synced 2024-10-27 20:34:04 +00:00

Add drops to entity

This commit is contained in:
TechnoVisionDev 2020-07-23 23:53:44 -07:00
parent ae4ee12175
commit 3bf0c35082
2 changed files with 48 additions and 3 deletions

View File

@ -29,10 +29,10 @@ public class HogEntity extends AnimalEntity {
super(type, worldIn);
}
public static AttributeModifierMap.MutableAttribute setCustomAttributes() {
//func_233666_p_ ---> registerAttributes()
//func_233815_a_ ---> createMutableAttribute()
return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MAX_HEALTH, 10.0D)
public static AttributeModifierMap.MutableAttribute setCustomAttributes() {
return MobEntity.func_233666_p_()
.createMutableAttribute(Attributes.MAX_HEALTH, 10.0D)
.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.25D);
}

View File

@ -0,0 +1,45 @@
{
"type": "minecraft:entity",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:set_count",
"count": {
"min": 1.0,
"max": 3.0,
"type": "minecraft:uniform"
}
},
{
"function": "minecraft:furnace_smelt",
"conditions": [
{
"condition": "minecraft:entity_properties",
"predicate": {
"flags": {
"is_on_fire": true
}
},
"entity": "this"
}
]
},
{
"function": "minecraft:looting_enchant",
"count": {
"min": 0.0,
"max": 1.0
}
}
],
"name": "minecraft:porkchop"
}
]
}
]
}