This commit is contained in:
nimsolated
2026-03-22 20:38:37 -07:00
parent ae0bd0f411
commit be17e85eef
22 changed files with 601 additions and 164 deletions

View File

@@ -0,0 +1,32 @@
package net.mcreator.arisrandomadditions.enchantment;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.item.enchantment.EnchantmentCategory;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.entity.EquipmentSlot;
import java.util.List;
public class LifeMendingEnchantmentEnchantment extends Enchantment {
private static final EnchantmentCategory ENCHANTMENT_CATEGORY = EnchantmentCategory.WEARABLE;
public LifeMendingEnchantmentEnchantment() {
super(Enchantment.Rarity.VERY_RARE, ENCHANTMENT_CATEGORY, EquipmentSlot.values());
}
@Override
public int getMinCost(int level) {
return 1 + level * 10;
}
@Override
public int getMaxCost(int level) {
return 6 + level * 10;
}
@Override
protected boolean checkCompatibility(Enchantment enchantment) {
return super.checkCompatibility(enchantment) && !List.of(Enchantments.MENDING).contains(enchantment);
}
}

View File

@@ -13,6 +13,7 @@ import net.minecraft.world.item.enchantment.Enchantment;
import net.mcreator.arisrandomadditions.enchantment.SunderingEnchantmentEnchantment;
import net.mcreator.arisrandomadditions.enchantment.RuiningEnchantmentEnchantment;
import net.mcreator.arisrandomadditions.enchantment.PassiveIncomeEnchantmentEnchantment;
import net.mcreator.arisrandomadditions.enchantment.LifeMendingEnchantmentEnchantment;
import net.mcreator.arisrandomadditions.ArisRandomAdditionsMod;
public class ArisRandomAdditionsModEnchantments {
@@ -20,4 +21,5 @@ public class ArisRandomAdditionsModEnchantments {
public static final RegistryObject<Enchantment> PASSIVE_INCOME_ENCHANTMENT = REGISTRY.register("passive_income_enchantment", () -> new PassiveIncomeEnchantmentEnchantment());
public static final RegistryObject<Enchantment> RUINING_ENCHANTMENT = REGISTRY.register("ruining_enchantment", () -> new RuiningEnchantmentEnchantment());
public static final RegistryObject<Enchantment> SUNDERING_ENCHANTMENT = REGISTRY.register("sundering_enchantment", () -> new SunderingEnchantmentEnchantment());
public static final RegistryObject<Enchantment> LIFE_MENDING_ENCHANTMENT = REGISTRY.register("life_mending_enchantment", () -> new LifeMendingEnchantmentEnchantment());
}

View File

@@ -15,6 +15,7 @@ import net.minecraft.world.item.BlockItem;
import net.mcreator.arisrandomadditions.item.WitherQuestionMarkItem;
import net.mcreator.arisrandomadditions.item.WandOfResizingItem;
import net.mcreator.arisrandomadditions.item.WandOfDrainingItem;
import net.mcreator.arisrandomadditions.item.TurdItem;
import net.mcreator.arisrandomadditions.item.StarWandItem;
import net.mcreator.arisrandomadditions.item.StarItem;
@@ -114,6 +115,7 @@ public class ArisRandomAdditionsModItems {
public static final RegistryObject<Item> BLACK_IRON_INGOT = REGISTRY.register("black_iron_ingot", () -> new BlackIronIngotItem());
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());
// Start of user code block custom items
// End of user code block custom items

View File

@@ -43,7 +43,6 @@ public class ArisRandomAdditionsModTabs {
tabData.accept(ArisRandomAdditionsModItems.STAR_WAND.get());
tabData.accept(ArisRandomAdditionsModItems.NETHERRACK_JUICE_BUCKET.get());
tabData.accept(ArisRandomAdditionsModItems.BEDROCK_PICKAXE.get());
tabData.accept(ArisRandomAdditionsModItems.BEDROCK_SWORD.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_PICKAXE.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_AXE.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_SHOVEL.get());
@@ -84,12 +83,14 @@ public class ArisRandomAdditionsModTabs {
tabData.accept(ArisRandomAdditionsModBlocks.MAGMA_BRICK_PRESSURE_PLATE.get().asItem());
tabData.accept(ArisRandomAdditionsModBlocks.MAGMA_BRICK_BUTTON.get().asItem());
} else if (tabData.getTabKey() == CreativeModeTabs.COMBAT) {
tabData.accept(ArisRandomAdditionsModItems.BEDROCK_SWORD.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_SWORD.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_ARMOR_HELMET.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_ARMOR_CHESTPLATE.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_ARMOR_LEGGINGS.get());
tabData.accept(ArisRandomAdditionsModItems.ORICHALCUM_ARMOR_BOOTS.get());
tabData.accept(ArisRandomAdditionsModItems.NIGHT_VISION_GOGGLES_HELMET.get());
tabData.accept(ArisRandomAdditionsModItems.WAND_OF_DRAINING.get());
}
}
}

View File

@@ -0,0 +1,68 @@
package net.mcreator.arisrandomadditions.item;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.Level;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Item;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.InteractionHand;
import net.minecraft.core.BlockPos;
import net.mcreator.arisrandomadditions.procedures.WandOfDrainingRightclickedProcedure;
import com.google.common.collect.Multimap;
import com.google.common.collect.ImmutableMultimap;
public class WandOfDrainingItem extends Item {
public WandOfDrainingItem() {
super(new Item.Properties().durability(0).fireResistant());
}
@Override
public float getDestroySpeed(ItemStack itemstack, BlockState blockstate) {
return 1;
}
@Override
public boolean mineBlock(ItemStack itemstack, Level world, BlockState blockstate, BlockPos pos, LivingEntity entity) {
itemstack.hurtAndBreak(1, entity, i -> i.broadcastBreakEvent(EquipmentSlot.MAINHAND));
return true;
}
@Override
public boolean hurtEnemy(ItemStack itemstack, LivingEntity entity, LivingEntity sourceentity) {
itemstack.hurtAndBreak(2, entity, i -> i.broadcastBreakEvent(EquipmentSlot.MAINHAND));
return true;
}
@Override
public InteractionResultHolder<ItemStack> use(Level world, Player entity, InteractionHand hand) {
InteractionResultHolder<ItemStack> ar = super.use(world, entity, hand);
WandOfDrainingRightclickedProcedure.execute(world, entity.getX(), entity.getY(), entity.getZ(), entity, ar.getObject());
return ar;
}
@Override
public int getEnchantmentValue() {
return 1;
}
@Override
public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) {
if (equipmentSlot == EquipmentSlot.MAINHAND) {
ImmutableMultimap.Builder<Attribute, AttributeModifier> builder = ImmutableMultimap.builder();
builder.putAll(super.getDefaultAttributeModifiers(equipmentSlot));
builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Tool modifier", -1f, AttributeModifier.Operation.ADDITION));
builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Tool modifier", -3, AttributeModifier.Operation.ADDITION));
return builder.build();
}
return super.getDefaultAttributeModifiers(equipmentSlot);
}
}

View File

@@ -0,0 +1,49 @@
package net.mcreator.arisrandomadditions.procedures;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.core.registries.Registries;
import net.mcreator.arisrandomadditions.init.ArisRandomAdditionsModEnchantments;
import javax.annotation.Nullable;
@Mod.EventBusSubscriber
public class LifeMendingProcedureProcedure {
@SubscribeEvent
public static void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
if (event.getHand() != event.getEntity().getUsedItemHand())
return;
execute(event, event.getLevel(), event.getEntity());
}
public static void execute(LevelAccessor world, Entity entity) {
execute(null, world, entity);
}
private static void execute(@Nullable Event event, LevelAccessor world, Entity entity) {
if (entity == null)
return;
if (!world.isClientSide()) {
if (entity.isShiftKeyDown() && EnchantmentHelper.getItemEnchantmentLevel(ArisRandomAdditionsModEnchantments.LIFE_MENDING_ENCHANTMENT.get(), (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY)) != 0
&& (entity instanceof LivingEntity _livEnt ? _livEnt.getHealth() : -1) > 1 && (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).isDamaged()
&& !(entity instanceof Player _plrCldCheck8 && _plrCldCheck8.getCooldowns().isOnCooldown((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem()))) {
if (entity instanceof Player _player)
_player.getCooldowns().addCooldown((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem(), 20);
entity.hurt(new DamageSource(world.registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.MAGIC)), 1);
(entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).setDamageValue((int) ((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getDamageValue() - 30));
}
}
}
}

View File

@@ -0,0 +1,60 @@
package net.mcreator.arisrandomadditions.procedures;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.sounds.SoundSource;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.core.registries.Registries;
import net.minecraft.core.BlockPos;
import java.util.Comparator;
public class WandOfDrainingRightclickedProcedure {
public static void execute(LevelAccessor world, double x, double y, double z, Entity entity, ItemStack itemstack) {
if (entity == null)
return;
Entity rightClickedEntity = null;
if (!world.isClientSide()) {
rightClickedEntity = (Entity) world.getEntitiesOfClass(LivingEntity.class,
AABB.ofSize(
new Vec3((entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getX()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getY()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getZ())),
4, 4, 4),
e -> true).stream().sorted(new Object() {
Comparator<Entity> compareDistOf(double _x, double _y, double _z) {
return Comparator.comparingDouble(_entcnd -> _entcnd.distanceToSqr(_x, _y, _z));
}
}.compareDistOf((entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getX()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getY()),
(entity.level().clip(new ClipContext(entity.getEyePosition(1f), entity.getEyePosition(1f).add(entity.getViewVector(1f).scale(5)), ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, entity)).getBlockPos().getZ())))
.findFirst().orElse(null);
if (!(rightClickedEntity == null) && !(entity instanceof Player _plrCldCheck7 && _plrCldCheck7.getCooldowns().isOnCooldown(itemstack.getItem()))) {
if (entity instanceof Player _player)
_player.getCooldowns().addCooldown(itemstack.getItem(), 10);
if (world instanceof Level _level) {
if (!_level.isClientSide()) {
_level.playSound(null, BlockPos.containing(x, y, z), ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.portal.ambient")), SoundSource.PLAYERS, (float) 0.85, 2);
} else {
_level.playLocalSound(x, y, z, ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.portal.ambient")), SoundSource.PLAYERS, (float) 0.85, 2, false);
}
}
rightClickedEntity.hurt(new DamageSource(world.registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.MAGIC)),
(float) ((rightClickedEntity instanceof LivingEntity _livEnt ? _livEnt.getMaxHealth() : -1) * 0.03));
if (entity instanceof LivingEntity _entity)
_entity.setHealth((float) ((entity instanceof LivingEntity _livEnt ? _livEnt.getHealth() : -1) + (rightClickedEntity instanceof LivingEntity _livEnt ? _livEnt.getMaxHealth() : -1) * 0.03));
}
}
}
}

View File

@@ -4,7 +4,7 @@ license="Academic Free License v3.0"
[[mods]]
modId="aris_random_additions"
version="2.0.0"
version="2.0.1"
displayName="Ari's Random Additions"
displayURL="https://mcreator.net"
logoFile="logo.png"
@@ -23,12 +23,6 @@ description="Random Additions by Ari. Created with MCreator."
side="BOTH"
[[dependencies.aris_random_additions]]
modId="photon"
mandatory=false
versionRange="[0,)"
ordering="NONE"
side="BOTH"
[[dependencies.aris_random_additions]]
modId="pehkui"
mandatory=false

View File

@@ -1,7 +1,7 @@
{
"advancements.condensed_netherrack_advancement.descr": "Condense Netherrack for the first time",
"item.nims_random_bullshit.magic_dust": "Magic Dust",
"block.nims_random_bullshit.penta_condensed_netherrack": "Penta-condensed Netherrack",
"item.nims_random_bullshit.magic_dust": "Magic Dust",
"item.nims_random_bullshit.orichalcum_armor_boots": "Orichalcum Boots",
"block.nims_random_bullshit.magma_brick_button": "Magma Brick Button",
"painting.nims_random_bullshit.shit_painting.title": "Shit Painting",
@@ -10,15 +10,15 @@
"item.aris_random_additions.ghoul_spawn_egg": "Ghoul Spawn Egg",
"gui.aris_random_additions.turd_gui.label_uh_ohh_stinky": "UH OHH!!! STINKY!!! UH OHH!!! STINKY!!! UH OHH!!! STINKY!!! UH OHH!!! STINKY!!! ",
"item.aris_random_additions.bedrock_shard": "Bedrock Shard",
"advancements.grave_digger_advancement.title": "We Must Dig!",
"item.aris_random_additions.bedrock_upgrade_template": "Bedrock Upgrade Template",
"advancements.grave_digger_advancement.title": "We Must Dig!",
"block.nims_random_bullshit.orichalcum_block": "Block of Orichalcum",
"block.nims_random_bullshit.rubber_slab": "Rubber Slab",
"item.nims_random_bullshit.bedrock_upgrade_template": "Bedrock Upgrade Template",
"block.aris_random_additions.magma_brick_pressure_plate": "Magma Brick Pressure Plate",
"item.nims_random_bullshit.bedrock_upgrade_template": "Bedrock Upgrade Template",
"advancements.orichalcum_set_advancement.descr": "Wear a full armor set of Orichalcum.",
"block.nims_random_bullshit.orichalcum_ore": "Orichalcum Ore",
"block.aris_random_additions.condensed_condensed_netherrack": "Condensed Condensed Netherrack",
"block.nims_random_bullshit.orichalcum_ore": "Orichalcum Ore",
"painting.aris_random_additions.turd_painting.author": "Ari/nim",
"item.nims_random_bullshit.wand_of_resizing": "Wand Of Resizing",
"item.nims_random_bullshit.gravedigger.description_1": "We must dig!",
@@ -27,13 +27,14 @@
"block.aris_random_additions.hexa_condensed_netherrack": "Hexa-condensed Netherrack",
"item.aris_random_additions.bedrock_sword": "Bedrock Sword",
"item.aris_random_additions.orichalcum_hoe": "Orichalcum Hoe",
"item.aris_random_additions.wand_of_draining": "Wand Of Draining",
"enchantment.aris_random_additions.passive_income_enchantment": "Passive Income",
"item.aris_random_additions.sand_dust": "Sand Dust",
"block.aris_random_additions.orichalcum_block": "Block of Orichalcum",
"gui.nims_random_bullshit.mailbox_gui.outbox_y_coord": "0",
"enchantment.nims_random_bullshit.ruining_enchantment": "Ruining",
"block.nims_random_bullshit.condensed_condensed_netherrack": "Condensed Condensed Netherrack",
"advancements.netherrack_juice_advancement.descr": "Obtain Netherrack Juice",
"block.nims_random_bullshit.condensed_condensed_netherrack": "Condensed Condensed Netherrack",
"block.nims_random_bullshit.quadra_condensed_netherrack": "Quadra-condensed Netherrack",
"gui.nims_random_bullshit.bedrockifier_gui.button_empty": "-\u003e",
"block.nims_random_bullshit.hexa_condensed_netherrack": "Hexa-condensed Netherrack",
@@ -66,8 +67,8 @@
"block.nims_random_bullshit.broken_glass": "Broken Glass",
"block.nims_random_bullshit.redstone_brick_walls": "Redstone Brick Wall",
"item.aris_random_additions.tux_spawn_egg": "Tux Spawn Egg",
"effect.nims_random_bullshit.summoned_entity_effect": "Summoned Entity",
"advancements.grave_digger_advancement.descr": "Obtain Gravedigger",
"effect.nims_random_bullshit.summoned_entity_effect": "Summoned Entity",
"item.aris_random_additions.netherrackite": "Netherrackite Ingot",
"advancements.orichalcum_advancement.title": "Folly Red",
"item.nims_random_bullshit.ghoul_spawn_egg": "Ghoul Spawn Egg",
@@ -79,8 +80,8 @@
"block.aris_random_additions.magma_bricks": "Magma Bricks",
"item.nims_random_bullshit.snow_golem_question_mark": "Snow Golem...?",
"item.aris_random_additions.gravedigger.description_0": "Right-Click on soul sand or soul soil to use them, summoning a ghoul that attacks hostile mobs.",
"advancements.bedrock_advancement.descr": "Obtain Bedrock",
"item.aris_random_additions.gravedigger.description_1": "We must dig!",
"advancements.bedrock_advancement.descr": "Obtain Bedrock",
"item.nims_random_bullshit.orichalcum_shovel": "Orichalcum Shovel",
"block.nims_random_bullshit.redstone_brick_stairs": "Redstone Brick Stairs",
"block.aris_random_additions.magma_brick_walls": "Magma Brick Wall",
@@ -102,6 +103,7 @@
"block.nims_random_bullshit.condensed_condensed_condensed_netherrack": "Condensed Condensed Condensed Netherrack",
"item.aris_random_additions.magic_egg": "Magic Egg",
"entity.nims_random_bullshit.ghoul": "Ghoul",
"enchantment.aris_random_additions.life_mending_enchantment": "Life Mending",
"block.aris_random_additions.redstone_brick_slabs": "Redstone Brick Slab",
"advancements.star_advancement.descr": "Obtain a Star",
"item.nims_random_bullshit.bedrock_pickaxe": "Bedrock Pickaxe",

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

View File

@@ -6,7 +6,7 @@
"item": "minecraft:totem_of_undying"
},
{
"item": "aris_random_additions:deleted_mod_element"
"item": "aris_random_additions:turd"
}
],
"result": {

View File

@@ -0,0 +1,24 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
" ab",
" ca",
"c "
],
"key": {
"a": {
"item": "minecraft:wither_skeleton_skull"
},
"b": {
"item": "minecraft:nether_star"
},
"c": {
"item": "minecraft:stick"
}
},
"result": {
"item": "aris_random_additions:wand_of_draining",
"count": 1
}
}

View File

@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"aris_random_additions:wand_of_draining",
"aris_random_additions:wand_of_resizing",
"aris_random_additions:orichalcum_pickaxe",
"aris_random_additions:bedrock_pickaxe",