Skip to content

Commit

Permalink
ajout de nouvelles fonctionnallités et item et craft
Browse files Browse the repository at this point in the history
  • Loading branch information
nono78380 authored and Noel3 committed Aug 28, 2022
1 parent 308abe5 commit 5b5ab54
Show file tree
Hide file tree
Showing 25 changed files with 513 additions and 0 deletions.
105 changes: 105 additions & 0 deletions dond_cheou_et_autre_trucs_chelou.mcreator
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,110 @@
"compiles": true,
"locked_code": false,
"registry_name": "badvillager"
},
{
"name": "Sussypeinture",
"type": "painting",
"sortid": 18,
"compiles": true,
"locked_code": false,
"registry_name": "sussypeinture"
},
{
"name": "Scaryloot",
"type": "loottable",
"sortid": 19,
"compiles": true,
"locked_code": false,
"registry_name": "scaryloot"
},
{
"name": "KDBpicture",
"type": "painting",
"sortid": 20,
"compiles": true,
"locked_code": false,
"registry_name": "kd_bpicture"
},
{
"name": "Hommagepicture",
"type": "painting",
"sortid": 21,
"compiles": true,
"locked_code": false,
"registry_name": "hommagepicture"
},
{
"name": "Explode_when_right_click",
"type": "procedure",
"sortid": 22,
"compiles": true,
"locked_code": false,
"registry_name": "explode_when_right_click",
"metadata": {
"dependencies": [
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
},
{
"name": "Explode_whe_is_destroy",
"type": "procedure",
"sortid": 23,
"compiles": true,
"locked_code": false,
"registry_name": "explode_whe_is_destroy",
"metadata": {
"dependencies": [
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
},
{
"name": "Explodeitem",
"type": "tool",
"sortid": 22,
"compiles": true,
"locked_code": false,
"registry_name": "explodeitem"
},
{
"name": "Sussypotioncraft",
"type": "recipe",
"sortid": 24,
"compiles": true,
"locked_code": false,
"registry_name": "sussypotioncraft"
}
],
"variable_elements": [],
Expand All @@ -189,6 +293,7 @@
"item.minecraft.splash_potion.effect.potionsus": "Splash Potion of MLG",
"item.dond_cheou_et_autre_trucs_chelou.forgestick": "stickcheet",
"item.minecraft.tipped_arrow.effect.potionsus": "Arrow of MLG",
"item.dond_cheou_et_autre_trucs_chelou.explodeitem": "Explodeitem",
"subtitles.sussy-song": "",
"itemGroup.tabdidsquesus_1": "Didsquesus 1",
"advancements.eatastick.title": "Eatastick",
Expand Down
7 changes: 7 additions & 0 deletions elements/Explode_whe_is_destroy.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"_fv": 33,
"_type": "procedure",
"definition": {
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"40\" y=\"40\"><field name=\"trigger\">farmland_trampled</field><next><block type=\"spawn_gem\"><field name=\"despawn\">FALSE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">Items.TNT_MINECART</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value><next><block type=\"spawn_gem\"><field name=\"despawn\">FALSE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">Items.TNT_MINECART</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value><next><block type=\"spawn_gem\"><field name=\"despawn\">FALSE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">Items.TNT_MINECART</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></next></block></next></block></next></block></xml>"
}
}
7 changes: 7 additions & 0 deletions elements/Explode_when_right_click.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"_fv": 33,
"_type": "procedure",
"definition": {
"procedurexml": "<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"event_trigger\" deletable=\"false\" x=\"40\" y=\"40\"><field name=\"trigger\">no_ext_trigger</field><next><block type=\"spawn_gem\"><field name=\"despawn\">FALSE</field><value name=\"block\"><block type=\"mcitem_all\"><field name=\"value\">Items.TNT_MINECART</field></block></value><value name=\"x\"><block type=\"coord_x\"></block></value><value name=\"y\"><block type=\"coord_y\"></block></value><value name=\"z\"><block type=\"coord_z\"></block></value><value name=\"pickUpDelay\"><block type=\"math_number\"><field name=\"NUM\">10</field></block></value></block></next></block></xml>"
}
}
35 changes: 35 additions & 0 deletions elements/Explodeitem.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"_fv": 33,
"_type": "tool",
"definition": {
"renderType": 0,
"texture": "tnt_stick",
"customModelName": "Normal",
"name": "Explodeitem",
"specialInfo": [
"this stick can summon tnt"
],
"creativeTab": {
"value": "COMBAT"
},
"toolType": "Special",
"harvestLevel": 1,
"efficiency": 1.0,
"attackSpeed": 5.0,
"enchantability": 10,
"damageVsEntity": 2.0,
"usageCount": 20,
"blocksAffected": [],
"hasGlow": false,
"repairItems": [],
"immuneToFire": false,
"stayInGridWhenCrafting": false,
"damageOnCrafting": false,
"onRightClickedInAir": {
"name": "Explode_whe_is_destroy"
},
"onRightClickedOnBlock": {
"name": "Explode_when_right_click"
}
}
}
9 changes: 9 additions & 0 deletions elements/Hommagepicture.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"_fv": 33,
"_type": "painting",
"definition": {
"texture": "hommage.png",
"width": 16,
"height": 16
}
}
9 changes: 9 additions & 0 deletions elements/KDBpicture.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"_fv": 33,
"_type": "painting",
"definition": {
"texture": "kirby.png",
"width": 32,
"height": 32
}
}
48 changes: 48 additions & 0 deletions elements/Scaryloot.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"_fv": 33,
"_type": "loottable",
"definition": {
"type": "Chest",
"pools": [
{
"minrolls": 1,
"maxrolls": 2,
"minbonusrolls": 1,
"maxbonusrolls": 2,
"hasbonusrolls": true,
"entries": [
{
"type": "item",
"item": {
"value": "CUSTOM:Scary"
},
"weight": 1,
"minCount": 1,
"maxCount": 3,
"minEnchantmentLevel": 0,
"maxEnchantmentLevel": 0,
"affectedByFortune": true,
"explosionDecay": false,
"silkTouchMode": 0
},
{
"type": "item",
"item": {
"value": "CUSTOM:Sussyitem"
},
"weight": 1,
"minCount": 1,
"maxCount": 1,
"minEnchantmentLevel": 0,
"maxEnchantmentLevel": 0,
"affectedByFortune": false,
"explosionDecay": false,
"silkTouchMode": 0
}
]
}
],
"name": "chests/scaryloot",
"namespace": "mod"
}
}
9 changes: 9 additions & 0 deletions elements/Sussypeinture.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"_fv": 33,
"_type": "painting",
"definition": {
"texture": "sus.png",
"width": 16,
"height": 16
}
}
23 changes: 23 additions & 0 deletions elements/Sussypotioncraft.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"_fv": 33,
"_type": "recipe",
"definition": {
"recipeType": "Brewing",
"xpReward": 0.0,
"cookingTime": 200,
"recipeRetstackSize": 1,
"group": "",
"recipeShapeless": false,
"brewingInputStack": {
"value": "Items.POTIONITEM"
},
"brewingIngredientStack": {
"value": "CUSTOM:Scary"
},
"brewingReturnStack": {
"value": "POTION:CUSTOM:Potionsus"
},
"name": "sussypotioncraft",
"namespace": "mod"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.mcreator.dondcheouetautretrucschelou.item.SussyitemItem;
import net.mcreator.dondcheouetautretrucschelou.item.ScaryItem;
import net.mcreator.dondcheouetautretrucschelou.item.ForgestickItem;
import net.mcreator.dondcheouetautretrucschelou.item.ExplodeitemItem;
import net.mcreator.dondcheouetautretrucschelou.DondCheouEtAutreTrucsChelouMod;

public class DondCheouEtAutreTrucsChelouModItems {
Expand All @@ -22,4 +23,5 @@ public class DondCheouEtAutreTrucsChelouModItems {
public static final RegistryObject<Item> SUSSYITEM = REGISTRY.register("sussyitem", () -> new SussyitemItem());
public static final RegistryObject<Item> FORGESTICK = REGISTRY.register("forgestick", () -> new ForgestickItem());
public static final RegistryObject<Item> SUSSYSWORD = REGISTRY.register("sussysword", () -> new SussyswordItem());
public static final RegistryObject<Item> EXPLODEITEM = REGISTRY.register("explodeitem", () -> new ExplodeitemItem());
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ public class DondCheouEtAutreTrucsChelouModPaintings {
@SubscribeEvent
public static void registerMotives(RegistryEvent.Register<Motive> event) {
event.getRegistry().register(new Motive(80, 80).setRegistryName("sans"));
event.getRegistry().register(new Motive(16, 16).setRegistryName("sussypeinture"));
event.getRegistry().register(new Motive(32, 32).setRegistryName("kd_bpicture"));
event.getRegistry().register(new Motive(16, 16).setRegistryName("hommagepicture"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@

package net.mcreator.dondcheouetautretrucschelou.item;

import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.Level;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.CreativeModeTab;
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.InteractionResult;
import net.minecraft.world.InteractionHand;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.Component;
import net.minecraft.core.BlockPos;

import net.mcreator.dondcheouetautretrucschelou.procedures.Explode_when_right_clickProcedure;
import net.mcreator.dondcheouetautretrucschelou.procedures.Explode_whe_is_destroyProcedure;

import java.util.List;

import com.google.common.collect.Multimap;
import com.google.common.collect.ImmutableMultimap;

public class ExplodeitemItem extends Item {
public ExplodeitemItem() {
super(new Item.Properties().tab(CreativeModeTab.TAB_COMBAT).durability(20));
}

@Override
public float getDestroySpeed(ItemStack itemstack, BlockState blockstate) {
return List.of().contains(blockstate.getBlock()) ? 1f : 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);
Explode_whe_is_destroyProcedure.execute(world, entity.getX(), entity.getY(), entity.getZ());
return ar;
}

@Override
public int getEnchantmentValue() {
return 10;
}

@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", 0f, AttributeModifier.Operation.ADDITION));
builder.put(Attributes.ATTACK_SPEED,
new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Tool modifier", 1, AttributeModifier.Operation.ADDITION));
return builder.build();
}
return super.getDefaultAttributeModifiers(equipmentSlot);
}

@Override
public void appendHoverText(ItemStack itemstack, Level world, List<Component> list, TooltipFlag flag) {
super.appendHoverText(itemstack, world, list, flag);
list.add(new TextComponent("this stick can summon tnt"));
}

@Override
public InteractionResult useOn(UseOnContext context) {
InteractionResult retval = super.useOn(context);
Explode_when_right_clickProcedure.execute(context.getLevel(), context.getClickedPos().getX(), context.getClickedPos().getY(),
context.getClickedPos().getZ());
return retval;
}
}
Loading

0 comments on commit 5b5ab54

Please sign in to comment.