-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ajout de nouvelles fonctionnallités et item et craft
- Loading branch information
nono78380
authored and
Noel3
committed
Aug 28, 2022
1 parent
308abe5
commit 5b5ab54
Showing
25 changed files
with
513 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
src/main/java/net/mcreator/dondcheouetautretrucschelou/item/ExplodeitemItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.