pala M-gadget-5: pierre stats + epee couac (AFTER_DAMAGE)
This commit is contained in:
@@ -113,6 +113,10 @@ public final class PalaItems {
|
||||
public static final Item PALADIUM_PICKAXE = register("paladium_pickaxe", id -> new Item(new Item.Properties().setId(id).pickaxe(PalaToolMaterials.PALADIUM_PICKAXE, 2.0F, -3.0F)));
|
||||
public static final Item PALADIUM_SHOVEL = register("paladium_shovel", id -> new Item(new Item.Properties().setId(id).shovel(PalaToolMaterials.PALADIUM_SHOVEL, 11.0F, -3.0F)));
|
||||
public static final Item PALADIUM_SWORD = register("paladium_sword", id -> new Item(new Item.Properties().setId(id).sword(PalaToolMaterials.PALADIUM_SWORD, 8.0F, -2.3F)));
|
||||
// M-gadget-5 (wiki items lucky ID 5021/5035 VERIFIE) : pierre stats + epee couac
|
||||
// (memes caracteristiques que l'epee paladium, bruit de poulet a chaque coup).
|
||||
public static final Item STATS_STONE = register("stats_stone", id -> new Item(new Item.Properties().setId(id).stacksTo(1)));
|
||||
public static final Item COUAC_SWORD = register("couac_sword", id -> new Item(new Item.Properties().setId(id).sword(PalaToolMaterials.PALADIUM_SWORD, 8.0F, -2.3F)));
|
||||
public static final Item PICKAXE_OF_THE_GOD = register("pickaxe_of_the_god", id -> new Item(new Item.Properties().setId(id).pickaxe(PalaToolMaterials.PICKAXE_OF_THE_GOD, 1.8F, -3.0F).component(DataComponents.UNBREAKABLE, Unit.INSTANCE)));
|
||||
public static final Item PICKAXE_OF_THE_GOD_LEVE6 = register("pickaxe_of_the_god_leve6", id -> new Item(new Item.Properties().setId(id).pickaxe(PalaToolMaterials.PICKAXE_OF_THE_GOD_LEVE6, 0.4F, -2.9F).component(DataComponents.UNBREAKABLE, Unit.INSTANCE)));
|
||||
public static final Item PICKAXE_OF_THE_GOD_LEVEL1 = register("pickaxe_of_the_god_level1", id -> new Item(new Item.Properties().setId(id).pickaxe(PalaToolMaterials.PICKAXE_OF_THE_GOD_LEVEL1, 0.0F, -3.0F).component(DataComponents.UNBREAKABLE, Unit.INSTANCE)));
|
||||
|
||||
@@ -73,6 +73,8 @@ public final class PalaTabs {
|
||||
output.accept(PalaItems.GRAPPIN);
|
||||
output.accept(PalaItems.FISHBOWL);
|
||||
output.accept(PalaItems.WEIGHTED_BOOTS);
|
||||
output.accept(PalaItems.STATS_STONE);
|
||||
output.accept(PalaItems.COUAC_SWORD);
|
||||
output.accept(PalaItems.CANDY);
|
||||
output.accept(PalaItems.CANDY_BLUE);
|
||||
output.accept(PalaItems.CANDY_GREEN);
|
||||
|
||||
@@ -142,6 +142,14 @@ public final class PalaItemUseEvents {
|
||||
effect(sp, MobEffects.RESISTANCE, 1, 5);
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
// M-gadget-5 (wiki ID 5021) : pierre de statistiques = joueurs connectes.
|
||||
if (item == PalaItems.STATS_STONE) {
|
||||
int n = sl.getServer().getPlayerCount();
|
||||
sp.sendSystemMessage(net.minecraft.network.chat.Component.literal(
|
||||
"§6[Stats] §7" + n + " joueur" + (n > 1 ? "s" : "") + " connecte"
|
||||
+ (n > 1 ? "s" : "") + "."));
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
// M-gadget-2 (wiki items lucky) : grappin — clic droit air, raycast 32 blocs,
|
||||
// tirage instantane vers le point d'impact (ECART : pas de crochet visible).
|
||||
if (item == PalaItems.GRAPPIN) {
|
||||
|
||||
@@ -34,6 +34,26 @@ public final class PalaJobEvents {
|
||||
|
||||
public static void register() {
|
||||
ServerLivingEntityEvents.AFTER_DEATH.register(PalaJobEvents::afterDeath);
|
||||
ServerLivingEntityEvents.AFTER_DAMAGE.register(PalaJobEvents::afterDamage);
|
||||
}
|
||||
|
||||
// M-gadget-5 (wiki ID 5035) : epee couac — bruit de poulet a chaque coup porte
|
||||
// avec l'epee en main (tueur = source directe, item en main principale).
|
||||
private static void afterDamage(LivingEntity entity, DamageSource source, float dealt,
|
||||
float taken, boolean blocked) {
|
||||
Entity killer = source.getEntity();
|
||||
if (!(killer instanceof ServerPlayer player)) {
|
||||
return;
|
||||
}
|
||||
if (player.getMainHandItem().is(fr.surviepote.pala.PalaItems.COUAC_SWORD)) {
|
||||
ServerLevel level = player.level();
|
||||
BlockPos pos = player.blockPosition();
|
||||
// ECART 26.3 : CHICKEN_AMBIENT remplace par variants (ChickenSoundVariants,
|
||||
// non resolubles simplement cote serveur) -> CHICKEN_EGG (cot-cot).
|
||||
level.playSound(null, pos.getX(), pos.getY(), pos.getZ(),
|
||||
net.minecraft.sounds.SoundEvents.CHICKEN_EGG,
|
||||
net.minecraft.sounds.SoundSource.PLAYERS, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
private static void afterDeath(LivingEntity entity, DamageSource source) {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "pala:item/couac_sword"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "pala:item/stats_stone"
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@
|
||||
"item.pala.amethyst_mixed_coal": "Amethyst Mixed Coal",
|
||||
"item.pala.amethyst_stick": "Amethyst Stick",
|
||||
"item.pala.compressed_amethyst": "Compressed Amethyst",
|
||||
"item.pala.stats_stone": "Pierre de statistiques",
|
||||
"item.pala.couac_sword": "Epee couac",
|
||||
"item.pala.weighted_boots": "Boom Boots",
|
||||
"item.pala.fishbowl": "Bocal a poissons",
|
||||
"item.pala.grappin": "Grappin",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "pala:item/couac_sword"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "pala:item/stats_stone"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 197 B |
Binary file not shown.
|
After Width: | Height: | Size: 263 B |
Reference in New Issue
Block a user