travelersbackpack-fabric-1.20.1-9.1.11 #3780
Unanswered
oleg12054
asked this question in
Mod Dev Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
package com.tiviacz.travelersbackpack.common;
import net.minecraft.entity.player.PlayerEntity;
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.fabricmc.fabric.api.event.player.UseEntityCallback;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import com.jamieswhiteshirt.reachentityattributes.ReachEntityAttributes;
import com.tiviacz.travelersbackpack.blockentity.TravelersBackpackBlockEntity;
import com.tiviacz.travelersbackpack.component.ComponentUtils;
import com.tiviacz.travelersbackpack.init.ModBlocks;
import com.tiviacz.travelersbackpack.init.ModItems;
import com.tiviacz.travelersbackpack.inventory.ITravelersBackpackInventory;
import com.tiviacz.travelersbackpack.inventory.TravelersBackpackInventory;
import com.tiviacz.travelersbackpack.util.BackpackUtils;
import com.tiviacz.travelersbackpack.util.TimeUtils;
import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant;
import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleVariantStorage;
import net.fabricmc.fabric.api.transfer.v1.transaction.Transaction;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FluidBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityPose;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.ai.TargetPredicate;
import net.minecraft.entity.attribute.EntityAttribute;
import net.minecraft.entity.attribute.EntityAttributeInstance;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.mob.GhastEntity;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.entity.projectile.SmallFireballEntity;
import net.minecraft.fluid.Fluids;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.particle.BlockStateParticleEffect;
import net.minecraft.particle.ParticleEffect;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.explosion.Explosion;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.entity.EntityType;
import net.minecraft.util.TypedActionResult;
import net.minecraft.entity.damage.DamageSource;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import javax.security.auth.Destroyable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
public class BackpackAbilities
{
///
private static boolean isLightningStruck = false;
private static long lightningStruckTime = 0;
private static final long LIGHTNING_EFFECT_DURATION = 600; // 30 seconds (20 ticks per second)
///
}
Please help me, I can't use the method correctly:
public void onInitialize() {
// Регистрация обратного вызова для атаки молнии
AttackEntityCallback.EVENT.register((player, world, hand, entity, hitResult) -> {
if (entity.getType() == EntityType.LIGHTNING_BOLT && entity.getUuidAsString().equals("some_uuid")) {
onStruckByLightning(player);
}
return ActionResult.PASS;
});
And the code causes errors:
error: cannot find symbol
MinecraftClient.getInstance().textRenderer.drawWithShadow(matrixStack, timerText, 10, 10, 0xFFFFFF);
^
symbol: method drawWithShadow(MatrixStack,String,int,int,int)
location: variable textRenderer of type TextRenderer
error: no suitable method found for createExplosion(PlayerEntity,double,double,double,float,boolean,DestructionType)
world.createExplosion(player, player.getX(), player.getY(), player.getZ(), explosionPower, true, Explosion.DestructionType.DESTROY);
^
method World.createExplosion(Entity,double,double,double,float,boolean,ExplosionSourceType) is not applicable
(argument mismatch; DestructionType cannot be converted to ExplosionSourceType)
method World.createExplosion(Entity,DamageSource,ExplosionBehavior,Vec3d,float,boolean,ExplosionSourceType) is not applicable
(argument mismatch; double cannot be converted to DamageSource)
error: no suitable method found for createExplosion(PlayerEntity,double,double,double,float,boolean,DestructionType)
world.createExplosion(player, player.getX(), player.getY(), player.getZ(), explosionPower, true, Explosion.DestructionType.DESTROY);
^
method World.createExplosion(Entity,double,double,double,float,boolean,ExplosionSourceType) is not applicable
(argument mismatch; DestructionType cannot be converted to ExplosionSourceType)
method World.createExplosion(Entity,DamageSource,ExplosionBehavior,Vec3d,float,boolean,ExplosionSourceType) is not applicable
(argument mismatch; double cannot be converted to DamageSource)
Beta Was this translation helpful? Give feedback.
All reactions