togar2 / minestompvp Goto Github PK
View Code? Open in Web Editor NEWCombat library for Minestom
License: Apache License 2.0
Combat library for Minestom
License: Apache License 2.0
I'm looking into using the MinestomPvP
API in my server but can't seem to find a Maven/Gradle repository to do so. What's the recommended way to hook into the API?
Hello! I am running minestorm 1c528d8ae2 and minestormpvp a373305 and I have a issue regarding an unknown method. I have initialized minestormpvp, registered default events, and when I start the server it throws an exception:
Exception in thread "main" java.lang.NoSuchMethodError: 'boolean net.minestom.server.item.Material.isFood()'
at io.github.togar2.pvp.food.FoodComponents.loadFromRegistry(FoodComponents.java:141)
at io.github.togar2.pvp.food.FoodComponents.registerAll(FoodComponents.java:126)
at io.github.togar2.pvp.PvpExtension.init(PvpExtension.java:52)
The material class does not have the method isFood()
When player crouches and shoots snowball at pitch more than 60, snowball will get stuck in block without removing itself.
Upon removing block, snowball starts falling again and can interact with blocks normally.
You take regular fall damage in water as if it wasn't there, same with slime blocks, hay bales and beds. I believe lava has some damage reduction too.
Hello, I have the following problem...
If I want to hit a player it only works 2-3 times then it doesn't work anymore. It only works if the player I want to hit gets damaged again by something else (e.g. falling damage) In my opinion this is not normal xD
1.21 added several features and fixes related to combat
And most importantly
when shooting projectiles(tested with snowballs and arrows), they are rubberbanding
Support for flying with elytra (e.g. taking less fall damage, crashing into walls)
It would be nice to have events for fishing rods or maybe just a singular with a state like cast or retracted.
Hey, I'm trying to get get PVP on an specific instance working.
Minestom's eventNode.appendChild
within an Instance accepts as an Parameter
EventNode<? extends InstanceEvent>
MinestomPvp returs from PvpExtension.legacyEvents()
or the new Builder EventNode <EntityEvent>
In all examples are always global event listener used, is there a way to register pvp events on specific Instances or even only players?
Thanks!
I have a listener for ProjectileCollideWithBlockEvent, however it is not called when I throw a snowball (even though I have it implemented with this code:)
node.addChild(
PvPConfig
.emptyBuilder()
.projectile(ProjectileConfig.emptyBuilder(false).snowball(true).build())
.build().createNode()
)
I need to use this event as opposed to the ProjectileBlockHitEvent, because that class does not contain things I need like collissionPosition and block.
Hey, I tried to use this on my Minestom CE server and it sadly failed to work. The Extension class isn't present in the latest Minestom versions anymore. Can you look at that?
Line 134 of the DamageListener.java class will consistently cancel the DamageEvent.
@Override
public void setCancelled(boolean cancel) {
StackFrame frame = StackWalker.getInstance().walk(stream -> stream.skip(1).findFirst().get());
System.out.println("DamageEvent Cancellation changed by "
+ frame.getFileName() + ":" + frame.getLineNumber() + " to "
+ cancel);
this.cancelled = cancel;
}
During testing, I compiled a custom Minestom version that changes the setCancelled
function of the EntityDamageEvent to the above code- effectively printing out whenever the value was changed, and by what.
In my own code, I listened to the EntityDamageEvent with a priority of -1 to run this;
System.out.println("Damage event " + event.getDamage() + " Cancelled? " + event.isCancelled()
+ " Tracker Invuln " + Tracker.invulnerableTime.get(event.getEntity().getUuid())
+ " Last Dmg " + Tracker.lastDamageTaken.getOrDefault(event.getEntity().getUuid(), -1f) + "");
This gives the following output; (using a Diamond Sword against another player)
Damage event 1.61024 Cancelled? false Tracker Invuln 20 Last Dmg 10.525438
DamageEvent Cancellation changed by DamageListener.java:134 to true
PvP code is started as so, and MinestomPvP is used as an extension, compiled from Jitpack's Maven Repo. Happy to attach anything else that is needed/debug further.
GlobalEventHandler globalEventHandler = MinecraftServer.getGlobalEventHandler();
EventNode<EntityEvent> pvpEvents = PvpExtension.events();
globalEventHandler.addChild(pvpEvents);
Feel free to DM on Discord- Gatt#0010
java.lang.NoSuchMethodError: 'void net.minestom.server.network.packet.server.play.SoundEffectPacket.(net.minestom.server.sound.SoundEvent, net.kyori.adventure.sound.Sound$Source, net.minestom.server.coordinate.Point, float, float)'
at Ext_PvpExtension//io.github.bloepiloepi.pvp.listeners.DamageListener.handleEntityDamage(DamageListener.java:377)
at Ext_PvpExtension//io.github.bloepiloepi.pvp.listeners.DamageListener.lambda$events$0(DamageListener.java:56)
at net.minestom.server.event.EventListener$Builder$1.run(EventListener.java:151)
at net.minestom.server.event.EventNodeImpl$Handle.callListener(EventNodeImpl.java:488)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$listenersConsumer$8(EventNodeImpl.java:420)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:391)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:399)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:399)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:399)
at net.minestom.server.event.EventNodeImpl$Handle.call(EventNodeImpl.java:324)
at net.minestom.server.event.EventNode.call(EventNode.java:190)
at net.minestom.server.event.EventNode.callCancellable(EventNode.java:215)
at net.minestom.server.event.EventDispatcher.callCancellable(EventDispatcher.java:18)
at net.minestom.server.entity.LivingEntity.damage(LivingEntity.java:340)
at Ext_PvpExtension//io.github.bloepiloepi.pvp.listeners.FallDamageHandler.handleFallDamage(FallDamageHandler.java:81)
at Ext_PvpExtension//io.github.bloepiloepi.pvp.listeners.DamageListener.lambda$events$2(DamageListener.java:72)
at net.minestom.server.event.EventListener$Builder$1.run(EventListener.java:151)
at net.minestom.server.event.EventNodeImpl$Handle.callListener(EventNodeImpl.java:488)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$listenersConsumer$8(EventNodeImpl.java:420)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:391)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:399)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:399)
at net.minestom.server.event.EventNodeImpl$Handle.lambda$createConsumer$5(EventNodeImpl.java:399)
at net.minestom.server.event.EventNodeImpl$Handle.call(EventNodeImpl.java:324)
at net.minestom.server.event.EventNode.call(EventNode.java:190)
at net.minestom.server.event.EventDispatcher.call(EventDispatcher.java:10)
at net.minestom.server.listener.PlayerPositionListener.processMovement(PlayerPositionListener.java:57)
at net.minestom.server.listener.PlayerPositionListener.playerPositionListener(PlayerPositionListener.java:24)
at net.minestom.server.listener.manager.PacketListenerManager.processClientPacket(PacketListenerManager.java:90)
at net.minestom.server.entity.Player.lambda$interpretPacketQueue$16(Player.java:1808)
at org.jctools.queues.MpscUnboundedXaddArrayQueue.drain(MpscUnboundedXaddArrayQueue.java:312)
at net.minestom.server.entity.Player.interpretPacketQueue(Player.java:1808)
at net.minestom.server.entity.Player.update(Player.java:345)
at net.minestom.server.entity.Entity.tick(Entity.java:541)
at net.minestom.server.thread.TickThread.tick(TickThread.java:66)
at net.minestom.server.thread.TickThread.run(TickThread.java:41)
When trying to shoot an arrow from a bow or crossbow, no arrow shoots or gets used.
This happens when registering either CombatFeatures.modernVanilla() or CombatFeatures.VANILLA_PROJECTILE_ITEM and CombatFeatures.VANILLA_BOW (or crossbow).
There is no way to get position of hit block from ProjectileBlockHitEvent.
For projectiles with hitanticipation, there is no way to tell hit block location, because it is calculated as pos.add(velocity*0.06), but at time of event firing, velocity is already set to zero.
Players get exactly the same knockback in water as if the water is not there. In Vanilla the player gets less knockback in the water
Could you implement Crystals and Respawn Anchors?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.