mirror of
https://github.com/nimsolated/Nims-Random-BS.git
synced 2026-04-02 10:20:42 -07:00
2.0.2
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
|
||||
package net.mcreator.arisrandomadditions.client.renderer;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer;
|
||||
import net.minecraft.client.renderer.entity.HumanoidMobRenderer;
|
||||
import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
||||
import net.minecraft.client.model.geom.ModelLayers;
|
||||
import net.minecraft.client.model.HumanoidModel;
|
||||
|
||||
import net.mcreator.arisrandomadditions.entity.AriEntity;
|
||||
|
||||
public class AriRenderer extends HumanoidMobRenderer<AriEntity, HumanoidModel<AriEntity>> {
|
||||
public AriRenderer(EntityRendererProvider.Context context) {
|
||||
super(context, new HumanoidModel<AriEntity>(context.bakeLayer(ModelLayers.PLAYER)), 0.5f);
|
||||
this.addLayer(new HumanoidArmorLayer(this, new HumanoidModel(context.bakeLayer(ModelLayers.PLAYER_INNER_ARMOR)), new HumanoidModel(context.bakeLayer(ModelLayers.PLAYER_OUTER_ARMOR)), context.getModelManager()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureLocation(AriEntity entity) {
|
||||
return new ResourceLocation("aris_random_additions:textures/entities/ari.png");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
|
||||
package net.mcreator.arisrandomadditions.entity;
|
||||
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.network.PlayMessages;
|
||||
import net.minecraftforge.network.NetworkHooks;
|
||||
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.ServerLevelAccessor;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.monster.Monster;
|
||||
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
|
||||
import net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal;
|
||||
import net.minecraft.world.entity.ai.goal.TemptGoal;
|
||||
import net.minecraft.world.entity.ai.goal.RandomStrollGoal;
|
||||
import net.minecraft.world.entity.ai.goal.RandomLookAroundGoal;
|
||||
import net.minecraft.world.entity.ai.goal.MeleeAttackGoal;
|
||||
import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
|
||||
import net.minecraft.world.entity.ai.goal.FloatGoal;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
|
||||
import net.minecraft.world.entity.SpawnPlacements;
|
||||
import net.minecraft.world.entity.SpawnGroupData;
|
||||
import net.minecraft.world.entity.MobType;
|
||||
import net.minecraft.world.entity.MobSpawnType;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.damagesource.DamageTypes;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.DifficultyInstance;
|
||||
import net.minecraft.world.Difficulty;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
||||
import net.mcreator.arisrandomadditions.procedures.AriOnInitialEntitySpawnProcedure;
|
||||
import net.mcreator.arisrandomadditions.init.ArisRandomAdditionsModItems;
|
||||
import net.mcreator.arisrandomadditions.init.ArisRandomAdditionsModEntities;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class AriEntity extends Monster {
|
||||
public AriEntity(PlayMessages.SpawnEntity packet, Level world) {
|
||||
this(ArisRandomAdditionsModEntities.ARI.get(), world);
|
||||
}
|
||||
|
||||
public AriEntity(EntityType<AriEntity> type, Level world) {
|
||||
super(type, world);
|
||||
setMaxUpStep(0.6f);
|
||||
xpReward = 0;
|
||||
setNoAi(false);
|
||||
setCustomName(Component.literal("Ari"));
|
||||
setCustomNameVisible(true);
|
||||
setPersistenceRequired();
|
||||
this.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(ArisRandomAdditionsModItems.ORICHALCUM_SWORD.get()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet<ClientGamePacketListener> getAddEntityPacket() {
|
||||
return NetworkHooks.getEntitySpawningPacket(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerGoals() {
|
||||
super.registerGoals();
|
||||
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2, false) {
|
||||
@Override
|
||||
protected double getAttackReachSqr(LivingEntity entity) {
|
||||
return this.mob.getBbWidth() * this.mob.getBbWidth() + entity.getBbWidth();
|
||||
}
|
||||
});
|
||||
this.goalSelector.addGoal(2, new TemptGoal(this, 1, Ingredient.of(ArisRandomAdditionsModItems.ORICHALCUM.get()), false));
|
||||
this.goalSelector.addGoal(3, new LookAtPlayerGoal(this, Player.class, (float) 6));
|
||||
this.goalSelector.addGoal(4, new RandomStrollGoal(this, 1));
|
||||
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal(this, Mob.class, true, true));
|
||||
this.targetSelector.addGoal(6, new HurtByTargetGoal(this));
|
||||
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
|
||||
this.goalSelector.addGoal(8, new FloatGoal(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MobType getMobType() {
|
||||
return MobType.UNDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeWhenFarAway(double distanceToClosestPlayer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMyRidingOffset() {
|
||||
return -0.35D;
|
||||
}
|
||||
|
||||
protected void dropCustomDeathLoot(DamageSource source, int looting, boolean recentlyHitIn) {
|
||||
super.dropCustomDeathLoot(source, looting, recentlyHitIn);
|
||||
this.spawnAtLocation(new ItemStack(ArisRandomAdditionsModItems.ORICHALCUM.get()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoundEvent getAmbientSound() {
|
||||
return ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.chime"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playStepSound(BlockPos pos, BlockState blockIn) {
|
||||
this.playSound(ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.step")), 0.15f, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoundEvent getHurtSound(DamageSource ds) {
|
||||
return ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.hit"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public SoundEvent getDeathSound() {
|
||||
return ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.amethyst_block.break"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hurt(DamageSource damagesource, float amount) {
|
||||
if (damagesource.is(DamageTypes.FALL))
|
||||
return false;
|
||||
if (damagesource.is(DamageTypes.CACTUS))
|
||||
return false;
|
||||
return super.hurt(damagesource, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType reason, @Nullable SpawnGroupData livingdata, @Nullable CompoundTag tag) {
|
||||
SpawnGroupData retval = super.finalizeSpawn(world, difficulty, reason, livingdata, tag);
|
||||
AriOnInitialEntitySpawnProcedure.execute(this);
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
SpawnPlacements.register(ArisRandomAdditionsModEntities.ARI.get(), SpawnPlacements.Type.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES,
|
||||
(entityType, world, reason, pos, random) -> (world.getDifficulty() != Difficulty.PEACEFUL && Monster.isDarkEnoughToSpawn(world, pos, random) && Mob.checkMobSpawnRules(entityType, world, reason, pos, random)));
|
||||
}
|
||||
|
||||
public static AttributeSupplier.Builder createAttributes() {
|
||||
AttributeSupplier.Builder builder = Mob.createMobAttributes();
|
||||
builder = builder.add(Attributes.MOVEMENT_SPEED, 0.3);
|
||||
builder = builder.add(Attributes.MAX_HEALTH, 20);
|
||||
builder = builder.add(Attributes.ARMOR, 3);
|
||||
builder = builder.add(Attributes.ATTACK_DAMAGE, 3);
|
||||
builder = builder.add(Attributes.FOLLOW_RANGE, 16);
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import net.mcreator.arisrandomadditions.entity.TuxEntity;
|
||||
import net.mcreator.arisrandomadditions.entity.TurdProjectileEntity;
|
||||
import net.mcreator.arisrandomadditions.entity.PocketLightningProjectileEntity;
|
||||
import net.mcreator.arisrandomadditions.entity.GhoulEntity;
|
||||
import net.mcreator.arisrandomadditions.entity.AriEntity;
|
||||
import net.mcreator.arisrandomadditions.ArisRandomAdditionsMod;
|
||||
|
||||
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
@@ -36,6 +37,10 @@ public class ArisRandomAdditionsModEntities {
|
||||
.setUpdateInterval(1).sized(0.5f, 0.5f));
|
||||
public static final RegistryObject<EntityType<TurdProjectileEntity>> TURD_PROJECTILE = register("turd_projectile",
|
||||
EntityType.Builder.<TurdProjectileEntity>of(TurdProjectileEntity::new, MobCategory.MISC).setCustomClientFactory(TurdProjectileEntity::new).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).sized(0.5f, 0.5f));
|
||||
public static final RegistryObject<EntityType<AriEntity>> ARI = register("ari",
|
||||
EntityType.Builder.<AriEntity>of(AriEntity::new, MobCategory.MONSTER).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(AriEntity::new)
|
||||
|
||||
.sized(0.6f, 1.8f));
|
||||
|
||||
// Start of user code block custom entities
|
||||
// End of user code block custom entities
|
||||
@@ -48,6 +53,7 @@ public class ArisRandomAdditionsModEntities {
|
||||
event.enqueueWork(() -> {
|
||||
GhoulEntity.init();
|
||||
TuxEntity.init();
|
||||
AriEntity.init();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,5 +61,6 @@ public class ArisRandomAdditionsModEntities {
|
||||
public static void registerAttributes(EntityAttributeCreationEvent event) {
|
||||
event.put(GHOUL.get(), GhoulEntity.createAttributes().build());
|
||||
event.put(TUX.get(), TuxEntity.createAttributes().build());
|
||||
event.put(ARI.get(), AriEntity.createAttributes().build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.client.renderer.entity.ThrownItemRenderer;
|
||||
|
||||
import net.mcreator.arisrandomadditions.client.renderer.TuxRenderer;
|
||||
import net.mcreator.arisrandomadditions.client.renderer.GhoulRenderer;
|
||||
import net.mcreator.arisrandomadditions.client.renderer.AriRenderer;
|
||||
|
||||
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||
public class ArisRandomAdditionsModEntityRenderers {
|
||||
@@ -22,5 +23,6 @@ public class ArisRandomAdditionsModEntityRenderers {
|
||||
event.registerEntityRenderer(ArisRandomAdditionsModEntities.TUX.get(), TuxRenderer::new);
|
||||
event.registerEntityRenderer(ArisRandomAdditionsModEntities.POCKET_LIGHTNING_PROJECTILE.get(), ThrownItemRenderer::new);
|
||||
event.registerEntityRenderer(ArisRandomAdditionsModEntities.TURD_PROJECTILE.get(), ThrownItemRenderer::new);
|
||||
event.registerEntityRenderer(ArisRandomAdditionsModEntities.ARI.get(), AriRenderer::new);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ public class ArisRandomAdditionsModItems {
|
||||
public static final RegistryObject<Item> RAVE_BLOCK = block(ArisRandomAdditionsModBlocks.RAVE_BLOCK);
|
||||
public static final RegistryObject<Item> TURD = REGISTRY.register("turd", () -> new TurdItem());
|
||||
public static final RegistryObject<Item> WAND_OF_DRAINING = REGISTRY.register("wand_of_draining", () -> new WandOfDrainingItem());
|
||||
public static final RegistryObject<Item> ARI_SPAWN_EGG = REGISTRY.register("ari_spawn_egg", () -> new ForgeSpawnEggItem(ArisRandomAdditionsModEntities.ARI, -65448, -1, new Item.Properties()));
|
||||
|
||||
// Start of user code block custom items
|
||||
// End of user code block custom items
|
||||
|
||||
@@ -75,6 +75,7 @@ public class ArisRandomAdditionsModTabs {
|
||||
} else if (tabData.getTabKey() == CreativeModeTabs.SPAWN_EGGS) {
|
||||
tabData.accept(ArisRandomAdditionsModItems.GHOUL_SPAWN_EGG.get());
|
||||
tabData.accept(ArisRandomAdditionsModItems.TUX_SPAWN_EGG.get());
|
||||
tabData.accept(ArisRandomAdditionsModItems.ARI_SPAWN_EGG.get());
|
||||
} else if (tabData.getTabKey() == CreativeModeTabs.REDSTONE_BLOCKS) {
|
||||
tabData.accept(ArisRandomAdditionsModBlocks.REDSTONE_BRICKS.get().asItem());
|
||||
tabData.accept(ArisRandomAdditionsModBlocks.REDSTONE_BRICK_STAIRS.get().asItem());
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package net.mcreator.arisrandomadditions.procedures;
|
||||
|
||||
import virtuoel.pehkui.api.ScaleTypes;
|
||||
import virtuoel.pehkui.api.ScaleOperations;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.util.Mth;
|
||||
|
||||
public class AriOnInitialEntitySpawnProcedure {
|
||||
public static void execute(Entity entity) {
|
||||
if (entity == null)
|
||||
return;
|
||||
double pickedScale = 0;
|
||||
pickedScale = Mth.nextDouble(RandomSource.create(), 0.5, 1.5);
|
||||
ScaleTypes.HEIGHT.getScaleData(entity).setTargetScale((float) ScaleOperations.SET.applyAsDouble(ScaleTypes.HEIGHT.getScaleData(entity).getTargetScale(), pickedScale));
|
||||
ScaleTypes.WIDTH.getScaleData(entity).setTargetScale((float) ScaleOperations.SET.applyAsDouble(ScaleTypes.WIDTH.getScaleData(entity).getTargetScale(), pickedScale));
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ license="Academic Free License v3.0"
|
||||
|
||||
[[mods]]
|
||||
modId="aris_random_additions"
|
||||
version="2.0.1"
|
||||
version="2.0.2"
|
||||
displayName="Ari's Random Additions"
|
||||
displayURL="https://mcreator.net"
|
||||
logoFile="logo.png"
|
||||
|
||||
@@ -146,6 +146,7 @@
|
||||
"effect.aris_random_additions.summoned_entity_effect": "Summoned Entity",
|
||||
"item.nims_random_bullshit.orichalcum": "Orichalcum",
|
||||
"advancements.magic_egg_advancement.descr": "Obtain a Magic Egg",
|
||||
"entity.aris_random_additions.ari": "Ari",
|
||||
"item.nims_random_bullshit.night_vision_goggles_helmet": "Night Vision Goggles",
|
||||
"block.aris_random_additions.orichalcum_ore": "Orichalcum Ore",
|
||||
"item.aris_random_additions.orichalcum_axe": "Orichalcum Axe",
|
||||
@@ -167,6 +168,7 @@
|
||||
"block.aris_random_additions.condensed_condensed_condensed_netherrack": "Condensed Condensed Condensed Netherrack",
|
||||
"advancements.star_wand_advancement.title": "Healius Absorbus!",
|
||||
"advancements.magic_egg_advancement.title": "Core of a Spawner",
|
||||
"item.aris_random_additions.ari_spawn_egg": "Ari Spawn Egg",
|
||||
"entity.aris_random_additions.tux": "Tux",
|
||||
"item.nims_random_bullshit.orichalcum_pickaxe": "Orichalcum Pickaxe",
|
||||
"item.aris_random_additions.magic_dust": "Magic Dust",
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"type": "forge:add_spawns",
|
||||
"biomes": [
|
||||
"snowy_beach",
|
||||
"snowy_plains",
|
||||
"snowy_taiga",
|
||||
"cherry_grove",
|
||||
"snowy_slopes"
|
||||
],
|
||||
"spawners": {
|
||||
"type": "aris_random_additions:ari",
|
||||
"weight": 9,
|
||||
"minCount": 1,
|
||||
"maxCount": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "misc",
|
||||
"pattern": [
|
||||
"aba",
|
||||
"bcb",
|
||||
"dbd"
|
||||
],
|
||||
"key": {
|
||||
"a": {
|
||||
"item": "minecraft:poppy"
|
||||
},
|
||||
"b": {
|
||||
"item": "aris_random_additions:orichalcum"
|
||||
},
|
||||
"c": {
|
||||
"item": "minecraft:fox_spawn_egg"
|
||||
},
|
||||
"d": {
|
||||
"item": "minecraft:sweet_berries"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "aris_random_additions:ari_spawn_egg",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "misc",
|
||||
"pattern": [
|
||||
"aba",
|
||||
"bcb",
|
||||
"dbd"
|
||||
],
|
||||
"key": {
|
||||
"a": {
|
||||
"item": "minecraft:chicken"
|
||||
},
|
||||
"b": {
|
||||
"item": "minecraft:sweet_berries"
|
||||
},
|
||||
"c": {
|
||||
"item": "aris_random_additions:magic_egg"
|
||||
},
|
||||
"d": {
|
||||
"item": "minecraft:rabbit"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "minecraft:fox_spawn_egg",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user