public final class ExceptionLogger extends Handler
{
@Override
public void publish(LogRecord record)
{
if(record.getThrown() != null)
{
Throwable exception = record.getThrown();
if(exception instanceof DebugException)
DebugMessage.exception((DebugException) exception);
else
DebugMessage.exception(new TvheeAPIException(record.getSourceClassName(), record.getSourceMethodName(), exception));
}
}
@Override
public void flush()
{
}
@Override
public void close() throws SecurityException
{
}
}```
`Bukkit.getLogger().addHandler(new ExceptionLogger());`
How can I filter exceptions from other plugins?
#help-development
1 messages · Page 1531 of 1
isn't the bukkit loggers a shared one ?
Yes that is the problem, and Bukkit doesn't log the exceptions on the plugin's logger
iterate over their loggers ?
they are exposed through JavaPlugin#getLogger
note tho, you would be injecting a class of plugin a into the class loader of plugin b
I just set my handler in JavaPlugin.getLogger() ?
Ok let's try
jesus christ this maven package is downloading a lot of stuff
keep in mind the "you are passing in a class from a different class loader into another plugin"
Ok
world.spawnParticle(Particle.SPELL_WITCH, location, 1);
How would I modify this to make it so the spawned particle doesnt move?
world.spawnParticle(Particle.SPELL_WITCH, loc, 1, 0, 0, 0, 0);
might work
the first three 0 are the random offset
x,y, and z respectively
that you do not want
the last one should be time/extra ?
I don't get any further line on my logging file (Yes it isn't working, I also don't see a custom print)
maybe spell_witch is just one of those particles that doesn't allow movement data ¯_(ツ)_/¯
hmm ill playa round with it
why was this deprecated and is there a replacement for it? https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/block/BlockPistonRetractEvent.html#getRetractLocation()
or do I have to check if piston is sticky and then use the direction to figure out the retract location
because it can pull more than one block
yep it was the particle itself, it moved as it faded apparently
oh right, didn't notice it isn't a collection
yea there is getBlocks in addition to getBlock
you can calculate the location using the direction provided in the event
there is isSticky
np
am I right in saying that if isSticky is false, BlockPistonRetractEvent.getBlocks will be empty?
Im confused a bit about bungee's event naming. I checked docs and figure it out something but not sure.
What's the name of event that called when player disconnects from server(ESC disconnect, not server change) will that event called when player is kicked too? [I think its PlayerDisconnectEvent]
What's the name of event that called when player connects to server(I need proxiedplayer instance, not server change)
[I think its PostLoginEvent]
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.equals(Object)" because the return value of "org.bukkit.event.player.PlayerInteractEvent.getItem()" is null
if(event.getItem().equals(star)) {
supposedly the line triggering it
however
the line above is ```java
if(event.getAction().equals(Action.RIGHT_CLICK_AIR) || event.getAction().equals(Action.RIGHT_CLICK_BLOCK))
i only get the error if i look at a block while doing this
it still works fine
Item and ITemStack is different things.
Item is an entity, while ItemStack isn't
You can get ItemStack from Item
Item#getItemStack() or something like this.
Why is it null only when I look at a block?
I'm confused on that
w-who pinged me?!
me
your fault tbh
so check if its not null before i do it?
with that name
you have a stupid name and it auto completed for @ nullable
npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, "jeffmcjefferson");
Location location = event.getPlayer().getLocation();
npc.spawn(location);
location.setX(location.getX() + 30);
npc.getNavigator().setTarget(location);
This makes the npc go like a million miles an hour - citizens api
Anyone know how to speed them down to walking speed?
while theres Item and ItemStack getItem()which returns ItemStack is bad naming. I hate this.
I'm still kind of confused on why it is null when i look at a block in the first place
heh, rly kinda my fault. back to lurking elsewhere.
Sorry 🙂
look at the javadocs for that event
Kind of a random forum question, I've seen some plugin resource pages where the discussion section is disabled (not open for further replies) - how does one do that??
archived plugins I expect
hm no I don't think so, let me see if I can find an example. I swear I've seen it on a plugin I'm actively using
Yeah- LibsDisguses https://www.spigotmc.org/threads/libs-disguises-free.2192/
What is this magic
maybe it happened when it went inactive before libraryaddict picked it up?
Possibly. I have no options to close any discussion on mine
Could I in theory just use the citizens api to make the entity and then manually move it?
Using the getEntity()
Hmmm, there is no way to make an entity “walk” though with spigot is there?
Only teleport them
Does an entity position packet make the client move an entity from x to y with animation?
============
I basically need a way to translate a player move event onto another entity.
The entity at the moment is a citizen npc
So I’m thinking that I could use packets but idrk. The path finding with the citizens api is a bit stupid
import icalling.blindness.items.ItemManager;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Commands implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player)) {
sender.sendMessage("sorry console but only players can get cool kid items!!!");
}
Player player = (Player) sender;
if (command.getName().equalsIgnoreCase("giveblindnessitem"))
player.getInventory().addItem(ItemManager.blindnessball);
player.sendMessage(ChatColor.BLUE + "You have been given the partner item of blindness");
return true;
}``` this gives me an errorr in the chat and tells me thats it a null item in the console
why is that
and also
the code for the item
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
public class ItemManager {
public static ItemStack blindnessball;
public ItemManager() {
createblindness();
}
public ItemStack blindnessball() {
return blindnessball();
}
private void createEffectClearer() {
}
private static void createblindness() {
ItemStack item = new ItemStack(Material.INK_SAC, 1);
ItemMeta meta = item .getItemMeta();
meta.setDisplayName(ChatColor.YELLOW + "Blindness Ball");
List<String> lore = new ArrayList<>();
lore.add(ChatColor.GRAY + "This is Ghanaman's cool partner item");
lore.add(ChatColor.GRAY + "When you hit a player with this item they receive blindness");
meta.setLore(lore);
meta.addEnchant(Enchantment.LUCK, 1 ,false);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
blindnessball = item;
}
that should be self-explanatory
Not with spigot but I know a NMS method I used to use to make that happen
Do you know if packets make them "pathfind"
if you send a lot
I have no idea lol
i mean i guess if you send enough it will look smooth
i did and it doesnt work
I wasn’t using packets, I was just hijacking their navigation
still sais the item is a null
yeah me either, I looked all over .. oh well.
What I'd really love is to be able to shut down reviews, to be honest.. people are so toxic there I had to stop looking at them. I miss when we could report reviews, though I understand why it had to be removed.
fair
did you instantiate the ItemManager
wdym
how are you gonna set the item if the method for setting the item is never called
yeah
where did you instantiate the ItemManager
public void onEnable() {
// Plugin startup logic
getServer().getPluginManager().registerEvents(new EventsForBlindness(), this);
getCommand("giveblindnessitem").setExecutor(new Commands());```
so do you see the issue here
no
getCommand("giveblindnessitem").setExecutor(new Commands());
where do you see the instance of ItemManager
👍
all i wanted is to everything to be UWP consistent on windows 10
also they've redesigned the settings finally
all I wanted was for microsoft to be brave and implement windows 11 on top of linux kernel
yeaa that would be so cool
but it would require so much work
to port everything
including win 32
why is my yaw -33,000 ?
applications
i mean wine is here
but
they have source code they can port it, but that's just competitive in the market i guess
macos introduced a compatibility layer when they shifted to BSD
it wouldn't require that much work. Windows is whatever Microsoft says it is. Everyone else is forced to adapt to that.
also not like publishers could actually just disregard windows
they could have at least used their market share for something useful, now we have widgets
how do you make this packet
I have this:
PacketContainer packet = new PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE_LOOK);
packet.getIntegers()
.write(0, this.plugin.npc.getEntity().getEntityId());
packet.getShorts()
.write(0, (short) (1))
.write(1, (short) (0))
.write(2, (short) (0));
but im not sure how to get the angles
and what field they would be
how do i build a jar file
i have a server jar but when i run gradlew.bat i cant find the built file
yes i mean like paper and tuinity
but there servers are completly dead
paper is build using gradle applyPatches and then gradle paperclipJar
How use a custom schedule bukkit
hey I want to know what is not deprecated to create a schedule with the shedule api made by bukkit (I am in vc with @ivory garnet )
(1.16.5)
is there any difference to developing through paper and developing using spigot/bukkit?
i run my server on paper but i use spigot for developing
idk
that's not a problem
any idea why this is causing a ClassNotFoundException?
return houseInfoCache = (HouseInfo)SerializationUtils.deserialize(serialisedHouseInfo);
console:
Caused by: java.lang.ClassNotFoundException: kaktusz.kaktuszlogistics.modules.survival.world.housing.HouseInfo
HouseInfo implements Serializable and has a serialVersionUID
to developing the plugin straight from paper
there is no visible differences
thanks
declaration: package: org.bukkit.scheduler, interface: BukkitScheduler
i'm getting confused with this shit every fucking time...
let's say, i type ?command arg0 arg1 arg2, args.length would be 3 right?
but i mean.. that would mean if there are no args after the command, wouldn't it then be args.length == 0?`
because it then tells me args[0] is out of bounds. so in this case, what would be the way to identify the command
btw, it's supposed to be if(args[0].equals(?command)) in the picture of course
? is not a valid command being is it
it's not spigot
it's just a custom system. the prefix doesnt matter at all
just the args-system
Well then the length of your args depends entirely on you
whether or not it includes the command name itself
who knows
^^
i don't think you understand the question or i explained it wrong
spigot removes the command label from the args array
you're system doesn't
that looks like JDA
he's splitting an event message and setting that to String[] args
spigot does remove the command label from args
in your case the command ?kill me pls would be [?kill, me, pls]
hence your two args
my only question would actually be... what would be the command in my string array? i mean, args[0] seems to be out of bounds
at least ij says so
would actually result in an args.lenght == 3
/mycommand arg1 arg2
args[0] is "arg1"
args[1] is "arg2"
in your system
args[0] = "/mycommand"
args[1] = "arg1"
args[2] = "arg2"
why length 3? doesnt java start counting with 0
length is not counting
so length starts with 1?
["hello", "there"] has length == 2
where "hello" is found at arr[0]
it only makes sense
length is the amount of entries in the array, not the last valid index
Hey,
Is there a way to check if a player starts/stops crawling?
what is crawling? sneaking? PlayerToggleSneakEvent
If anyone knows the GUI mechanics of MC, please don't hesitate to answer. Thank you
https://www.spigotmc.org/threads/does-gui-spoofing-exist.512460/
if (!fm.isPlayerFriendsWith(p, to)) {
if (fm.getFriendRequest(p, to) == null) {
if (!p.equals(to)) {
fm.request(p, to);
} else {
p.sendMessage(getConfigString(plugin, "friends.cannot-friend-self"));
}
} else {
p.sendMessage(getConfigString(plugin, "friends.already-requested"));
}
} else {
p.sendMessage(getConfigString(plugin, "friends.already-friends-message"));
}```
why does this cause so much lag
its on bungeecord
No, not sneaking.
You can crawl in a 1 block hole
well
thats the swimming state if i'm right
so check if he is swimming, and not in water.
then he is actually crawling
depends entirely on the called methods. Are you running SQL queries on the main thread ?
Is there no event for that? :/
(EntityToggleSwimEvent only fires if the player is in water)
EntityPoseChangeEvent might work ?
I'll try that, thanks
is standard java serialisation unusable with spigot?
i.e. serialise to bytes, save as BYTE_ARRAY nbt, then deserialise
I do not recommend it at all
Java serialisation should never be used unless you have an idea what you are doing, but that would mean that you already know the answer to your question
I wanted to use it so I can take advantage of the transient keyword easily
One field added or removed and you have killed your savefiles
Especially stupid with obfuscated code
ok, how should I go about serialising and using default values in the case that a field is not specified
what are you wanting to serialize?
a HouseInfo object, which contains a list of RoomInfos, and a RoomInfo contains two integers, a list of BlockPositions (int, short, int) and a set of BlockPositions
private int floorArea = 0;
private int beds = 0;
private final List<BlockPosition> possibleConnectedRooms = new ArrayList<>();
private final Set<BlockPosition> encounteredDoors = new HashSet<>();
^RoomInfo
fairly basic, yes you can use java serialization, or depending on how you want to store them, Bukkit has its own serializer
I tried using java serialisation but I get a ClassNotFoundException for some reason
is BlockPosition your own class?
you clearly did something wrong then
is there a way to lock the direction which a entity is traveling, like I want wither skulls to fly in a straight line. If you just launch it it will start to fly horizontally
Both black and blue skulls curve upward, making it super hard to target mobs/players
does wither skulls count as
projectiles or entites
maybe it's due to the List and Set though
ALL objects in a class must be serializable
for whatever reason I remembered that collections serialised fine
are the objects in your Set and List serializable?
yes, all BlockPositions
wouldn't java throw a more specific error there?
is it because BlockPosition is a static final class inside another class?
thats what I was thinking
static final is irrelevant for you
The serializer has to be able to access the bytecode of the class
I don't see why it wouldn't, all saved classes are publicly accessible
On the bytecode layer it is pretty much irrelevant if the class is static or not while the final modifier just prevents you from extending the class, which is also irrelevant for you
thinking more that it being inside another class is the problem
nah
Your error says it can;t access HouseInfo
which is really weird
Javac changes such classes to OuterClass$InnerClass, so you will not have any issues here
package kaktusz.kaktuszlogistics.modules.survival.world.housing;
import kaktusz.kaktuszlogistics.util.minecraft.VanillaUtils;
import kaktusz.kaktuszlogistics.world.KLWorld;
import org.bukkit.ChunkSnapshot;
import org.bukkit.World;
import java.io.Serializable;
import java.util.*;
public class HouseInfo implements Serializable {
private static final long serialVersionUID = 100L;
[...]
Do you get any other stacktraces in your log?
I doubt it (given that is should throw an ClassDefNotFoundError in this case), but perhaps there is something wrong
https://hastebin.com/heneleloxo.properties this is the full error
Hello, I can't remember, but how can I stop my algorithm ?
no other errors pop up, serialising goes fine
the byte arrays are the same when serialised and when recovered from NBT
Two HouseInfo classes? I hope they have different Ids
@quiet ice I don't understand
You see, "algorithm" is very unspecific
there shouldn't be two HouseInfo classes
Is there anyway to get the direction a player is looking ?
where do you see that?
nm, me misreading
@quiet ice I would like to stop the execution of my command
return;
Bukkit.shutdown() should accomplish that
Easy route: throw new InternalException()
@tame coral Donc je fais return true; comme c'est un boolean ?
you can do it in 0 lines of code using the power button
that just shutdown the server
ouais
yes but it also doesnt run the command just like they asked
@tame coral D'accord merci
return false will print a message return true will return with nothing
@quiet ice Okay thank you 🙂
return croissant == null ? baguette : croissant;
lul
When I try to register an event which has a constructor with plugin in it, the line shows up red with the error below. Here's my constructor and event listener:
getServer().getPluginManager().registerEvents(new JoinListener(this), this); // this is red```
```java
public JoinListener(AutoTimeRank plugin) {
public Plugin plugin;
this.plugin = plugin;
}
I can't find anything in the docs
Get the vector of the player
does JoinListener implement Listener
throw new <any exception>(); will also print a nice message
second time I've made this mistake, thanks gecko!
also why is the plugin field defined in the constructor
it should be defined outside so it can be accessible in other methods
can't find it in the docs either
yeah
you mean the field in the constructor
LMAO
didnt notice that
@dry beacon for dependency injection to have any use, the field needs to be declared outside of the constructor and the type should be the plugin's class, not just Plugin
like AutoTimeRank instead of Plugin or JavaPlugin
?jd
smh no https
?
you know how spigotmc has a search bar and all that in the javadocs
is there a 1.8.8 hosted version with that search bar n stuffs
Firefox prints a large "this site is doing unsafe https shit" error when clicking on the jd link
Ah
Yeah, I didn't include it in my constructor, I have this in my class private final AutoTimeRank plugin;
bad question
but yes
is a wither skull an entity
okay lol
well, the block is not
thats wither skeleton skull
I guess that is true
theres no search bar on helpchat's javadocs :(
Go on the tree then ctrl f
there is still the index
This
but that is an issue with highly old java versions
is it a bad idea to register with ConfigurationSerialisable in a static code block
looks fishy, but if it works it works
why would it be?
wondering if it would mess up when deserialising a class that hasn't been accessed yet
well ConfigurationSerializable is probably already initialized
and the methods to serialize and deserialize arent called until its meant to be done
I mean, you can reference the same class inside the static block
so I dont see how it wouldnt be initialized when called 🤷♂️
but doesn't the static block only execute once the class is accessed from elsewhere
correct
Well, not really
The block executes once the class is loaded and initialized, which can also be done by the classloader or other external influences
so I don't need to worry that the block hasn't executed by the time I'm deserialising a byte array that may contain the class
I do not think that you need to - unless the serial lib uses stupid stuff
so i used intellij for a plugin but it doesnt find STAINED_GLASS_PANE
version?
Use the deprecated LEGACY_STAINED_GLASS_PANE instead
<COLOR>_STAINED_CLASS_PANE
and ignore the javadoc that tells you to NOT use it
TALL_GRASS, SUN_FLOWER etc..
using ConfigurationSerialisable, can I put a list or set as a value in the hashmap?
Are there any plugins / tools that could help test the performance of a server? I mean like vanilla MSPT.
Trying to see if a part of a plugin I'm working on has any performance impact
how can i replace all STAINED_GLASS_PANE to BLACK_STAINED_GLASS_PANE
obv can use spark or just bukkit to see the performance of the server, looking for something that can test the server
you can get the system time at the beginning of a code block, do a few thousand iterations, and then log the current time minus the time you started at
Well yeah, but I want something more quantifiable to an end user
.
what do you mean by that
so you want to lag the server on purpose right
yes thats one way to put it
loading a lot of chunks is a good idea
getBlock all blocks in a large plane
or a cube if you want to push it
Ok, that might work
Nah loading/genning new chunks should slow down the server the way I want
just keep in mind new chunks will lag more than loading existing chunks so your test results may be inconsistent
hook into a multiworld plugin and create a new world :kek:
but then theres that overhead
how can you get the hardness of a block
Hmmmm
could try set block over a large area
like a plane of sand with each block set individually
On second thought loading the world might not work
Do you means timings in spigot ?
Can you "make a server lag" with timings?
Ah sorry no
Here let me reword what I want
lots of pathfinding could do it too
I am trying to test the MSPT of a certain server and a certain plugin under a known amount of load
?jd
ty
To measure performance and if the plugin/server software has any impact
This would work but I'm also trying to factor in any impact the server software will have
idea:
choose a large area
every tick, set the y=0 layer to bedrock, set the y=1 and y=2 layers to air, kill all item entities and spawn falling sand entities at y=2
this should lag it quite a lot over say 128x128
Hmm
and the lag should be constant since items won't build up
cant i just set the vanilla gamerule dotiledrops false
yeah i was about to say
i want something that more realistically represents the server performance
pathfinding code might be on the right track but im not quite sure how to implement that
Oh well, just an opportunity to learn
you can do a DFS floodfill using getBlock
I have a better idea
Is there a way to make the server tick faster? Like tick warp in carpet
If all I want is the MSPT under a known amount of load I can just do that (if its possible) and then read the TPS
what type of load are you looking for
not sure if tick speed is modifiable in spigot
Just like
Load a plugin, let it do something
and then do that for x amount of ticks then see the results
and this "something" is the thing that should lag the server?
oh also explosions can get extremely laggy
Yes, a taxing task
Ill look around
not sure how optimised they are for empty areas though so if you go for explosions you might want to re-fill the area they destroy
can be done easily with an event listener which cancels the entity explode event
Probably with some hacky NMD
I would recommend forking spigot instead of trying to do it with a plugin
I wanted to test on multiple pieces of server software
Maybe a patch would be best then, but I have no idea where to start
Hello, I try to go through lintellij hot-swap tutorial but I end up with this error
C:\Users\korut\.jdks\openjdk-16.0.1\bin\java.exe -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:61698,suspend=y,server=n -Dfile.encoding=windows-1252 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.1\lib\idea_rt.jar" -jar "C:\Users\korut\Desktop\ArmyRP - Local Server\spigot-1.16.5.jar"
Connected to the target VM, address: '127.0.0.1:61698', transport: 'socket'
Unsupported Java detected (60.0). Only up to Java 15 is supported.
Disconnected from the target VM, address: '127.0.0.1:61698', transport: 'socket'
Process finished with exit code 0```
When I run the debugger.
Java 16 on a spigot 1.16.5 server won’t work
You know how to make it work?
This is my debug confg
For hotswapping I do recommend DCEVM
It's a special version of jdk 11 with better hotswapping support
is this a plugin?
.
Also update your server it's out of date
SpigotMC - High Performance Minecraft
BIG IMPORTANT NOTE, THIS GUIDE IS OUTDATED, SEE HERE FOR THE NEW VERSION: https://wiki.helpch.at/piggys-barn/java/hot-swapping
Before I get started,...
Lol read the preview
Oh yeah
Olivo is the real man (;
Whats wrong here:
@EventHandler
public void onInvClick(final InventoryClickEvent event) {
if (event.getInventory().getName() != " Bitcoin Market") {
return;
}
if (event.getCurrentItem() != null) {
getName -> Cannot resolve 'getname' in 'Inventory'
Well getName doesn't exist
what should i take
getTitle
okay tx
Also don't match inventories by name
getTitle also doesnt work
You need the inventory veiw iirc
How to get the Player teleported to spawn if He fall in void?
You have 3 options.
-
Listen to the damage event and check void damage. Then teleport
-
Listen to the player move event
-
Use the bukkit scheduler to tick the location
now it says Operator '!=' cannot be applied to 'org.bukkit.inventory.InventoryHolder', 'java.lang.String'
learn java
yh i started learning it but that small problem i need help
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
knowing java basics is a prerequisite for doing things with a java based server using a java based api
do me
for that plugin this is the only error
Hi i'm trying to make a simple plugin but after world loading the plugin throws
The embedded resource 'config.yml' cannot be found in plugins/NoKillSMP-1.0.0.jar and the issued line is line:22 which is saveDefaultConfig();
do you have the config.yml
yeah
show your project structure
is it actually in the jar
can't attach the pic
How do i give people a speed 2 potion that lasts for 1:30 minutes
y-yeah if the bot sends me at least the message...
im not trying to get the potion effect, but the potion itself...
you apply the potion effect to the potion
no thats deprecated
apparently you use PotionData now https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionData.html
great
@sage swift
i'm not seeing a config.yml in resources
idea made that file by default
where is your config.yml
the config yml needs to be in the jar
and for that to happen, it needs to be in the resources directory
i thought plugin.yml was the config (sorry this is my first plugin)
config.yml is the config
The embedded resource 'config.yml' cannot be found
the server told you it's config.yml
do you have the config.yml
gecko told you it's config.yml
If someone has an example for a entity moment + rotation packet I would appreciate it (protocollib ideally but nms 1.17 is fine)
Just @ me it
I can look thru my mod, pretty sure I got one there
Ok - nice
Oh nvm I will have to do it tmrw uh sry I failed you Jeff 😔
is it possible/does it causes any problem to use non-java librairies in our plugin minecraft coding ?
sure lets use python libraries im sure it'll work with the jvm yeahhh h yeah sure
right now the PlayerRiptideEvent cannot be cancelled for unknown reasons
whats the best way to "cancel" the event otherwise
I didnt mean that sorry
I meant non official java libraries
Is there a way to make it so you cant place a block? I am trying to make a block (dirt) that opens an inventory on right click and dont want it to be placed.
like java libraries but that have nothing to do with minecraft
java is java
minecraft is built on top of libraries that have nothing to do with minecraft
event.setcancelled(True)
that will cancel the block place
Would that work in the event “PlayerInteracrEvent”
it should
Ok ty
Is anyone familiar with Jackson Serialization. I'm a little confused with how to implement it into my plugin. I need to know how to Serialize a custom Class called customPlayer.java, which contains instances of other custom Classes.
Jackson 😬😬
Lol. Stack Overflow suggested I used it
ok ok
Hi, my server is being thread blocked, having near 500ms of lag according to timings when I try to read a YAML file in the join event on a 1.8 server on iSpigot on a Velocity network. I can just fix this by using async right?
Yea use AsyncPlayerPreLoginEvent
Then just load it there
Never do io on server thread my guy
How I can change value final variable?
Reflection, bytecode manipulation or unsafe
do i need to use JavaSE-16 as my execution enviornment JRE if im gonna make a 1.17 plugin
or do i still use JavaSE-8
1.8*
Anyways @quaint mantle I am experienced in Gson so I can help you with that if it’s fine
No for development java 8 will work fine in most cases
alright
maybe you can give me more help? 😅
Well Raymano give me more context
a oke I want change final ItemStack in spigot 1.17
I can just fix this by using async right?
typical words spoken by 1.8 developers
@ivory sleet Can I pm you?
private static Field invertModifiers(Field field, int... modifiers) throws NoSuchFieldException, IllegalAccessException {
if (!field.isAccessible()) field.setAccessible(true);
Field mod = Field.class.getDeclaredField("modifiers");
if (!mod.isAccessible()) mod.setAccessible(true);
for (final int modifier : modifiers) mod.setInt(field, field.getModifiers() & ~modifier);
return field;
}``` I try this code but don't work in java 16
you cannot pm him
only i can pm him
that is illegal
how?
you are just jealous
everyone is
Justify your argument 
i am jealous of a world where throwing async at shit solves all problems
"oh no i dont get 3 features instead of 20"
you complain about everything
You see Conclure life is all about 1.8
To be fair I like 1.16.5 more
I honestly don't care what version people program on
until they come here and need a solution to something which can be easily solved by simply upgrading
and nobody knows the answer to because to 1.8'ers ever answer questions and nobody else knows the answers
You answer mine all the time
your problems aren't usually 1.8 specific
except when they are, which is when I usually tell you to fuck off to 1.8 land
I try this but I don't understand this you can help me? java Value value = new Value(); Field field = invertModifiers(value.getClass().getDeclaredField("a"), Modifier.FINAL); field.set(value, "abcd"); System.out.println(value.a);
😦
You can say that I probably use 1.8 when I have no idea for the data base NON SENS
What.. are you doing
I try change final variables
you can't do that with unsafe easily either
this code only for test
You can’t do it pretty much
as unsafe requires you to get a Field object first to get its offset and shit
and java 16 doesn't let you get Field objects for private fields in propietary 'secure' classes
Why are you trying to change a final variable
^
the simplest solution to my problem
Asking about your attempted solution rather than your actual problem
?xy
he wants to confuse the results of the recipes
what
?
random receptures output
you don't touch the modifiers field anymore
you just use unsafe, it skips that part
he wants to change the final results of crafting to random
The ItemStack thing wouldn’t solve it
i guess I should change the lobotomizer timings integration to use unsafe instead of reflection
because apparently that is more fucking stable than using the actual api in java
neither unsafe or reflection is really supported 🙂
the only difference being is that reflection gets shat on and cucked and broken more with every new version
Unsafe is slowly being phased out for official API options
Unsafe isn’t any better tbh lol
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/CraftItemEvent.html also maybe this?
declaration: package: org.bukkit.event.inventory, class: CraftItemEvent
Unsafe is what the name stands
at least it doesn't break literally every version
Ig
based on experience reflection is more unsafe than unsafe
not like reflection breaks every version
no no
it breaks more and more every version
Why not
they are slowly securing the internals of the JDK which breaks some dumb reflection stuff
but... its very slow...
If you need access to those internals you're suppose to request for API changes
and then wait 20 years for them to be actually implemented and for my userbase to actually use that new version they were implemented in
until 1.17, java 1.8 was the most common version people used for minecraft servers
well for minecraft, mojang should be forcing the latest version anyway
what do you think should use unsafe?
but they'll prob stop at 1.17 cause they don't care
ProMoRRom why async?
so it'll only take 15 years instead of 20
That would only hurt performance

@proud basin isn't that right, nose and chin man
Run it as is
it is safe to run async afaik
What is right
@proud basin what you want to do?
but you should not explicitly schedule it to be run async if you're in a sync context
all playSound does is send a packet.. 0 reason to async it
Idk
but there is no need to schedule to sync if you're in an async context, either
Prom if it’s in async context already then sure but don’t bother to just do it cause of the sake of it
I used it asynchronous before and it doesn’t work for some reason
do it in whatever context you are in
I did it for my media plugin, asynchronous it’s weird
Like sometimes it works
Sometimes it doesn’t
why NNYaKNpGms0eUVpiSdHx ping you still? 😅
Are you high?
What do you mean it depends is it a yes or a no
you should use unsafe instead of reflection
is it about my height?
yes
I think yes
How about the other one
how tall are you, nose and chin man
did you put all of your points into the nose and chin in the character creation screen
it's a compliment
Pulse how tall r u lol
Like 5 foot 10
unsafe in dangerous to use?
just as dangeourus as reflection
Inch
nothing is dangeourus by itself
just say 5'10
Cause America dumb
How many centimeters :0
Well one inch is 2.54 cm
actually its 2.55
a oke no problem
No it isn’t
I swear world edit needs a rework or atleast better documentation lol
the issue with the documentation is precisely that
it's been reworked too many times
I can smell api breaking changes
all of the documentation and help discussions are for versions from like 2-3 reworks ago
I set it up to use fawe , but then it can't find the classes it needs
false information
Nope
Remembered it for 5 years
I know what it is
You are spitting false info
Lol
The thing is, the plugin is amazing but there's so little documentation to help people use it
working with worldedit or any other enginehub projects is pain
it always gives me a fucking aneurysm
calculate the diameter for a triangle then in cm
Dude I hit my head on the desk today using we
yeah it's fucking unreal
all of the documentation is either sparse, nonexistent, or outdated
I forgot it was weighted as well lol
same goes for all of the spigot threads
So I smashed a weighted mouse into my head
the best recourse is supposedly to go on their discord
apparently they help you there
"help"
Do they actually?
Heh
No they don't
yes
I got more chance of md5 releasing spigot updates quicker than them helping
how about getting rid of the material enum
Replacing it with?
or updating snakeyaml
I believe that would break the Bukkit config api but yeah that would be nice
I will likely reward someone who is able to help me with the fawe / worldedit api
yeah no thanks
I have used it once and it wasn’t the best experience but tbf it was reasonable
I don't know why I'm putting myself through the pain
I don't know why they make it so hard to paste a fucking schematic
Oh yeah that’s true
It's the most basic thing ever but you gotta do 15 things to prepare it :|
muh modularity
SOLID purism
Feels like it’s been proven they don’t go hand in hand everytime
The best part is I paid a certain user from this discord to make a plugin and now I gotta pay him more to get the thing updated lol
🥴
Even tho the code was broken at first
you have been brainwashed by capitalist propaganda
how I can change ItemStack use UnSafe?
You tried asking it to be unsafe? Or hanging it just on the edge that's unsafe.
read the guide that was linked to you
Is the only way to paste schematics using fawe to go through the absolute pain and horrible process what's out there?
https://worldedit.enginehub.org/en/latest/api/examples/clipboard/#pasting this is all they give but it just doesn't work at all. I was told you can write it with worldedit and fawe will work fine with it but it doesn't do anything
Value value = new Value();
Field field = Unsafe.class.getDeclaredField("theUnsafe");
field.setAccessible(true);
Unsafe unsafe = (Unsafe) field.get(null);
unsafe.putObject(value, unsafe.objectFieldOffset(value.getClass().getDeclaredField("a")), "abcd");
System.out.println(value.a);``` I check this for test
and I have one problem how variables is final I can't change it
without error but it don't change
or now change 🤨
howdy howdy
someone how after I use field
would someone be able to help me when they get the time
Hello there, is it possible to know if a player is actually using a spyglass?
just a quick question about plugin development
What's up
So I am trying to set up tab completion with strings but I don't know how
PlayerInteractEvent probably
I want the tabCompletion to be able to show stuff like ping or hours
stuff like that
why does it not work at the start, how do I remove the final works and how do I restore the final works 🧐
I'll try that, but I guess it will fire instantly and not when the spyglass is zoomed
Yeah true else we might have a new event making itself into the api
If it doesn’t already exist that is
I don't think it does, at least the 1.17 update post in the forum doesn't say anything about that
How would I change the knockback of a mob? I'm making it so that when you get hit by a mob you get knocked back 1000 blocks. I tried to change the velocity of the player that got hit in EntityDamageByEntityEvent but that will only knock the player back in a certain direction so it could end up shooting the player forward or to the side.
would anyone be able to help me with this? and if possible I would also like for it to pull from a list in a config.yml file
That is ofc if there’s a packet sent also
You have to set the velocity to the player vector minus mob vector
And multiply it until you get it to knock it 1000 blocks
thanks
Yeah, that was what I was thinking, maybe it is a client thing only
what have you gotten so far?
If theres a wiki on it i cant find it, but i used this https://bukkit.org/threads/easy-no-api-setting-up-custom-tab-completion.299956/
Hello,
Awhile ago I was looking for a way to use auto-tab-complete for one of my plugins. This is the function that allows a user who presses "tab"...
so I am making a plugin for a command on my server called /show and I want to set it up so that I can use getConfig.getStringList() to call strings
okay.. so get the string list from the config and return it
yea
so what do you need help with then?
hey, i'm trying to make a plugin that disables the elytra when a player takes damage from an entity. i already have a listener, i'm just not sure how to get the entity.Player from the Entity object returned when i do event.getEntity
this is what i have so far:
package io.github.fourinchknife.elycomtag.listeners;
import io.github.fourinchknife.elycomtag.ElyComTag;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.scoreboard.ScoreboardManager;
public class CombatTaggedListener implements Listener {
private final ElyComTag plugin;
private final ScoreboardManager scoreboardManager;
public CombatTaggedListener(ElyComTag plugin) {
this.plugin = plugin;
this.scoreboardManager = plugin.getServer().getScoreboardManager();
}
@EventHandler
public void onEntityDamaged(EntityDamageByEntityEvent event){
Entity attacker = event.getDamager();
Entity attacked = event.getEntity();
if (attacked.getType() != EntityType.PLAYER /*|| attacker.getType() != EntityType.PLAYER*/) return;
plugin.logger.info(attacked.getName()+" attacked by "+attacker.getName());
}
}
instead of doing Entity attacker - event.getEntity first do if (e.getEntity instanceof Player) { } then inside of the if statement do Player player = (Player) e.getEntity
so just cast it to Player?
yep
that's stupidly easy
just make sure you check that its a player first
thanks
yeah, of course
alright np
@wraith rapids why would u want to use Unsafe
dont you get it its Unsafe you shouldnt use it
package io.github.fourinchknife.elycomtag.listeners;
import io.github.fourinchknife.elycomtag.ElyComTag;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.scoreboard.ScoreboardManager;
public class CombatTaggedListener implements Listener {
private final ElyComTag plugin;
private final ScoreboardManager scoreboardManager;
public CombatTaggedListener(ElyComTag plugin) {
this.plugin = plugin;
this.scoreboardManager = plugin.getServer().getScoreboardManager();
}
@EventHandler
public void onEntityDamaged(EntityDamageByEntityEvent event){
if (event.getEntity() instanceof Player){
((Player) event.getEntity()).setGliding(false);
}
}
}
i'll give this a shot. does anything look obviously wrong?
yes unused variables are the best
why did you ping me
why not
sussy bakka
i'm going to end up using them later
it's going to be a combat tagging system
but it worked
turn's out it's kinda hard to hit yourself with a bow while elytraing
who says i cant
can you not
wait is it possible to display different scoreboards to users?
someones mad
I think so
k but is it possible to display different scoreboards to users?
i don't know
i dont think it is
cuz if it was
wouldnt it be possible in vanilla?
i meant without having to assign players to different teams
actually it might be possible without since i seen some plugins do it i think
ima search for tutorials maybe
Hello, I have an invunerable endercrystal, when I spawn an explosion next to it it disappears, what do I do to prevent this
block the event for it getting destroyed?
¯_(ツ)_/¯
@granite stirrup whats that event?
idk
??
yeah dont ask me
smh
declaration: package: org.bukkit.event.block, class: BlockExplodeEvent
@quaint mantle Arent those for blocks?
EnderCrystal is an entity
is there an event for when an entity gets removed
declaration: package: org.bukkit.event.entity, class: EntityExplodeEvent
idk, but maybe this also? https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDamageEvent.html
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
hmm
import me.Chewie.BubbleItems.items.CustomItems;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class OnRightClickMobEgg implements Listener {
@EventHandler
public static void onPlayerRightClick(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (player.getInventory().getItemInMainHand().getItemMeta() == CustomItems.giantSpawnEgg.getItemMeta()) {
Location location = player.getLocation();
player.getWorld().spawnEntity(location, EntityType.GIANT);
player.sendMessage(ChatColor.DARK_GREEN + "That is one big zombie!");
}
}
}
}
Im trying to have a custom zombie egg spawn a giant zombie rather than a small one, but it just spawns a regular one.. Not sure what i need to change to make that work
i was finally able to make my gui movement working properly ahhhhhhhhh
i'm dead rn
no clue what this actually does, but it works.. fuck my life
are you setting the eggMeta tho?
then thats your issue probably
ok
check out SpawnEggMeta#setSpawnedType()
ok
that only works for unknown explosions
i believe
and for blocks, which end crystal is not
YamlConfiguration.get() get object is suck
but theres no block explosions xd
It returns MemorySection instead of what inside file.yml
tnt is a entity

you can disable the EntityDespawnEvent (Or DeathEvent, idk if an endcrystal is handled under death or despawn) and cancel it if the last damagesource was explosion i guess
theres no EntityDespawnEvent in the javadocs
EntityDeathEvent is tho
it says LivingEntity, but endercrystals arent living entities
whats with EntityDamageEvent?
idk if cancelling that cancels the despawn/kill
and actually btw, there are indeed Block explosions
is that even cancellable XD
respawn anchor for example.. or that other nether thing that explodes in wrong dimension, idk
or bed maybe? idk if bed is an entity tho
how do you make custom events :)
make it @quaint mantle
and try and see if u can get spigot to use it
bet
i need some help, anyone up for the task?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
it's hard that that command has to exist lmao
s a y what you want help with not ask if you can
sorry, new to this server
thats not only on this server lol
never ask somebody if you can ask something
just ask.
lol
the plugin on my bukkit server is not being loaded
you got an error?
does it support bukkit and what errors?
and as well, that usually goes in #help-server in future
not even an error, it just says that there is no plugins
i mean maybe not just paste all of it here
it could contain a ip
?paste
i wasn't fast enough
also, no one literally uses his real ip in the server.properties. bc there's no reason for it
wellllll
there are probably some people who just wait for ip-exposure
i have before lol
cuz for some reason before it wouldnt work without it
lol
what should I be looking for in my log file?
or just drag the file into here, if you don't leak anything at all
nvm youre not verified. idk if you can link files
?paste
not really
make a client for 1.16/1.17 😰
it might take a while to edit my name and ip out
i saw a thing that actually removes ips
ItemStack item = new ItemStack(Material.ZOMBIE_SPAWN_EGG);
SpawnEggMeta spawneggmeta = (SpawnEggMeta) item.getItemMeta();
ItemMeta meta = item.getItemMeta();
spawneggmeta.setSpawnedType(EntityType.GIANT);
meta.setDisplayName(ChatColor.GREEN + "Giant Zombie");
meta.addEnchant(Enchantment.LUCK, 1, false);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.WHITE + "Spawns Giant Zombie!");
lore.add("");
//lore.add(TIER2);
lore.add(UNFINISHED);
meta.setLore(lore);
item.setItemMeta(meta);
item.setItemMeta(spawneggmeta);
giantSpawnEgg = item;
}
I did this and says its out of date as an error
can you pass things as references in java?
found it!
Could not load 'plugins\CreeperSpawn.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type
at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:969) ~[craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:240) ~[craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:163) ~[craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:138) [craftbukkit.jar:git-Bukkit-8160e29]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadPlugins(CraftServer.java:349) [craftbukkit.jar:git-Bukkit-8160e29]
at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:197) [craftbukkit.jar:git-Bukkit-8160e29]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:762) [craftbukkit.jar:git-Bukkit-8160e29]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:948) ~[craftbukkit.jar:git-Bukkit-8160e29]
... 7 more
wtf
who made that plugin if i gonna ask
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
this doesn't look like a simple bug for me at all. lol
what does that mean?
It means the developer tried to cast a String as a Map
show code
ItemStack item = new ItemStack(Material.ZOMBIE_SPAWN_EGG);
SpawnEggMeta spawneggmeta = (SpawnEggMeta) item.getItemMeta();
ItemMeta meta = item.getItemMeta();
spawneggmeta.setSpawnedType(EntityType.GIANT);
meta.setDisplayName(ChatColor.GREEN + "Giant Zombie");
meta.addEnchant(Enchantment.LUCK, 1, false);
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
ArrayList<String> lore = new ArrayList<>();
lore.add(ChatColor.WHITE + "Spawns Giant Zombie!");
lore.add("");
//lore.add(TIER2);
lore.add(UNFINISHED);
meta.setLore(lore);
item.setItemMeta(meta);
item.setItemMeta(spawneggmeta);
giantSpawnEgg = item;
}
is this wrong
ok
?paste
show plugin.yml
name: CreeperSpawn
version: 1.0
author: Jack
main: me.Jack.CreeperSpawn.Main
description: Spawns 10 creepers on player
commands:
creepspawn:
aliases: [cs]
description: /cs spawns 10 creepers on player