#help-development
1 messages · Page 1875 of 1
No I can't rn I ran out of time so I'll be back home at my PC in about 2 hrs
how to make this transition?
Block a = ;//;
...
Chest c = ; // from Block a
Having block a cast it to Chest type
Why do you want to cast it?
Why is there //; lol
u kidding?
Chest c = (Chest) a.getState();
Because i need to get the inventory of it
ok thanks
Bruh // is like for notes and stuff
?
Anyone who can explain me the difference?
are u serious typing that?
it does not matter?
Lol
hello?
https://pastebin.com/33NVZVgT
can anyone help me fix? :=
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
hey, i am listening for entity destroy packets to check when an entity gets out of render from the player and do something related to it, but the issue is that the packet only has the id. Is there another option else than looping all entities? It seems pretty inefficient to me
in an inventory or as a block placed in the world?
How can I reference test in here, it's not a key as it's just the name of the list
config.getList("Placed.test")
https://github.com/WesJD/AnvilGUI How do i make this work on Java 17? Or is there another way to do it using the Paper API or something?
I want to get a list of all the keys (like test) under Placed.
config.get("Placed"). keyset or seomthign close
getKeys(false)
config.get("Placed").getKeys(false)
that wouldn't work, but I'll try what you mean
https://pastebin.com/33NVZVgT
This doesent remove durability from fully repaired tools. anyone know how to fix?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Show us the reduce durability method
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
You’re increasing the durability right there in the code
you mean getDamage() +1?
thats how it works... becuase -1 would always repair it
Right
So no matter what you either add extra damage to the item or do nothing
If you do nothing, assuming this is hooked up to some event listener, the damage will still be added to the item as normal
Hi i want to ask if it possible to inject a custom channel to the current Bungeecord Netty. So them use that channel with a custom wrapper on Bungee and Spigot side. For seding update packets?
what is the correct name of this material now? LEGACY_FIREBALL
FIRE_CHARGE
thx!
if the InventoryAction is InventoryAction.COLLECT_TO_CURSOR is there a way to know what items were collected?
inventoryclickevent
I know the name of the event
I'm already listening to the event
once I know the event name is collect to cursor, how do I know what changed in the chest
.
inventoryclickevent triggers when you collect an item
so im trying to add a player to a team
the team says its registered, but adding the players name to the team doesnt seem to register them
is that not how you add a player to a team?
i see the deprecated method for adding a player but i didnt use that because its deprecated
Have search on spigotmc?
Like searching like this on google: "Spigotmc add player to a team"
i did that and all i could find was people saying to use the deprecated method
is that really the only way to do it? if it is then its strange that its deprecated
Ahh ok
addPlayer is deprecated due to "Teams can contain entries that aren't players"
you need to use addEntry i guess
and?
Is it possible to get vector from entity yRot?
I would like to replace entity direction with yRot
hy do you want to use vectors?
Team#setPrefix
yeah, but yRot is something like 2d direction, or im wrong? And i want to create vector, which has the same direction, which has yRot.
Any idea of why my menu api its not adding the items to the menu? What could be?
use this instead of setting the displayname
yep that worked thanks
yRot is simply a rotation about an axis. you can not generate a vector without the other rotation
np
What is the proper way for Citizen NPC to wait? (or plugin-way to wait?)
so otherwise
Vector dir = getBukkitEntity().getLocation().getDirection().multiply(1);
dir.setY(0.0);
Location loc = getBukkitEntity().getLocation();
Vector f = dir.multiply(-1);
Location locF = loc.clone().subtract(f.multiply(0.64));
Location locB = loc.clone().subtract(f.multiply(-1).multiply(1.54));
front.setYRot(getYRot());
Utils.teleportWithPackets(front, locF.getX(), loc.getY()+getDisplacement()-.016, locF.getZ());```I am currently teleporting the armorstand in front of the main entity, I use the direction for this, so the entity is teleported to where the main entity is looking, I would like the armorstand not to be teleported to where it is looking, but in the same direction as the main entity yRot.
?????
Oh nice the code link never been posted
get entity location. set pitch to -90 or 0 (I think). Then getDirection
lol
Wait i will post again my code
Some body can tell me where I can read about this stuffs or tell me what is cx, cz, tl, v and d ???
thanks
Its shown like that because the code its obfuscated i think
Are you sure?
Here you have. https://paste.md-5.net/
The problem is that the items never appear
yeah i dont think toString is affected by obfuscation
No, but it affect fields and methods
um
Like it doesnt put the buttons in the menu
check the link you sent lol
Ahh sorry
Im an idiot
https://paste.md-5.net/hasoyarito.java - It doesnt put the buttons in the menu
use setButon before the build
yes
Oh im an idiot
how to add something like 1d3min (1 day 3 minutes) to current date? I mean the input can be different for example 349094d 9039min
getName() or getCustomName() or getDisplayName() ... I have a player instance returned by Server.getPlayer() ... what do i use to get the correct username?
getName is player's username
I have made a class for that
But it doesnt support multiple
why when i am using
Position pos = //my position
pos.getBlock().setType(Material.OAK_SIGN);
Sign sign = (Sign)pos.getBlock().getState();
sign.setLine(0, "my string");
sign.setLine(1, "another");
It places a sign but it's empty? anyone have idea?
Thanks
Now it doesnt execute the commands and i let me take the item from the inventory
Somebody know how I can set a FISHING_HOOK on Player's head on my plugin, like this photo?
use Blockstate not Sign
Blockstate sign = (Sign) pos.getBlock().getState();
@winter mesa
I remember this for some of my plugins, maybe works
Okay and how to set lines on this BlockState?
I don't remember well its for a long time ago, but check sign.getState.setLine(); or something like this
always play with codes, 99% you find the problem
oh okay i found the problem my solution was ok just to
sign.update();
after setLine
Thanks for help
https://gist.github.com/WesJD/36e53368e68a37f797a9
I found this logging class, is this something I should use or rather stay away from?
👍
Why not just use the built in logger?
Bukkit's logger or JavaPlugin's logger?
Well it's sl4j
Java
this.getLogger().info("test"); then?
That's the java.util.logger yeah that works too
Don't reinvent the wheel unless you need to.
just create a class named Logging and paste the codes
then use Logging.method("message"); anywhere you want
is it possible to know the list of mods a player is using from the server side?
System.out.println SUCK
yeah, it seemed like a cool class but I wanted to avoid that so I decided to ask here
like make a plugin that reads the player's loaded mods
and it will cause annoying warnings on papermc servers
Better, pass the Logger depenency everywhere
Somebody know how I can set a FISHING_HOOK on Player's head on my plugin, like this photo?
wouldn't this be less useful than this.getLogger().info("test") though?
cant u use the APi for that ?
no
anyway I just helped him / she to that thing he / her want || my english sucks ...||
what with
setHookedEntity(Entity entity) ?
Ok
Personally I use sl4j. It's dependency is used by something in bukkit/spigot.
private static final Logger logger = LoggerFactory.getLogger(TestPlugin.class);
Can you tell me that api ?
why do you care about pronouns btw. Like, almost everyone in minecraft development are male, otherwise they'll have pronouns in bio or smth
declaration: package: org.bukkit.entity, interface: FishHook
thanks
i'll check that out too, thanks
lol, ok, nvm xd
is there a way to use hex in a string message? (like with ChatColor.translateAlternateColorCodes you can use the &# codes), and also does something like &c&3 work to combine the colors?
Nope
in a text component?
You can't combine colors using codes because one just overwrites the other.
https://www.spigotmc.org/goto/post?id=4240250#post-4240250 i found that for hex
Does it work?
I assume that with the picture they sent it should work
event:
https://github.com/hapily04/SkyMining/blob/master/src/main/java/me/hapily/plugins/skymining/events/ClickEvents.java
main class where it's being registered:
https://github.com/hapily04/SkyMining/blob/master/src/main/java/me/hapily/plugins/skymining/SkyMining.java
Bukkit.getPluginManager().registerEvents(new ClickEvents(), this);
why is my event not registering
What do you mean by not registering? As in it's not firing?
p.getInventory().getItemInMainHand().displayName().equals(Component.text("§5§lMines Selection Tool")) I imagine it's this statement that is never true and thus nothing in the event is actually activating. Try adding an else and sending the player a "you need to be holding the right item" message
Or use logging 🤷♂️
Yes
None of the debug msgs are firing
public void onClick(PlayerInteractEvent event){
// add log message here
Player p = event.getPlayer();
Do not use display name/lore to store data or compare items. Use persistent data API instead
?pdc
why is that?
with which event can I detect if boat was placed and cancel it
thought I had one there
guess I forgot
I'll test it out rn, thanks
because block place event won't work because it isn't entity
Simply because it wasnt meant to be used like this. Thats just decorations, and can be easily changed by player / other plugins
Well for multiple reasons. The #1 reason is because if you use persistentdataholder you can modify lore/name etc without worrying about anything code related being affected. It's tucked away in it's own little world.
EntityPlaceEvent
so
public void onEntitySpawn(EntityPlaceEvent e) {
if(e.getEntity().getType() == EntityType.BOAT) {
new BukkitRunnable() {
@Override
public void run() {
e.setCancelled(true);
}
}.runTaskLater(Bedwars.getInstance(), 60L);
}
}``` should work?
I want to delte boat after boat clutch
If you want to remove the boat use the remove method
Pass the placed entity into the runnable then delete it. An event can only be canceled before it's executed
So you can do
net.md_5.bungee.api.ChatColor.of("#1f85de")
```However I do not know where to go from here, what do i do with the given chat color?
What do you want to do with it
the event object will stay in scope if the runnable references to it, so you can still do e.getEntity within the runnable even long after the method stopped executing
just broadcast the message but color it with hex
what is the equivalent of getServer#getMinecraftVersion ( from Paper) for Spigot? I have tried getVersion and getBukkitVersion, neither return only the version.
public void onEntitySpawn(EntityPlaceEvent e) {
if(e.getEntity().getType() == EntityType.BOAT) {
Entity entity = e.getEntity();
new BukkitRunnable() {
@Override
public void run() {
entity.remove();
}
}.runTaskLater(Bedwars.getInstance(), 60L);
}
}``` like that?
You will have to use a regex to find it from the version string
Yeah but you only really need the entity from it hence the pass in the entity. You can pass in the whole event it's really up to you.
Yes
Do you know how I would use the regex to get it?
indeed
gg it works thanks
Thank you. I will try that!
I have another question, I don't know how I can make floating text
like that:
I can't paste images, but how I can make a floating text like on this website but with spigot
I'm trying to add the block to the player's event after the block-decay.time field
an invisible armor stand w/ a custom display name ig
Personally I use the holographic displays API to do my tags cause they've got such a rich API for it
But when I just add the item to the player's inventory, it gives it twice
Certain events sometimes run twice, such as inventoryclickevent
You can avoid this by setting up a cooldown on a timer with a runnable
Sounds more like a workaround
That as well
I have a cooldown of 5 ticks on my inventoryclickevents where it's needed
What's the best solution then?
Nvm i have an idea
Copy the block type
Cancel the event before adding the block
Or just cancelling after
I'll just experimebt
Attach a debugger to the event and then look at the variables present in the underlying implementation of the event. There's probably a good reason why it is called twice
If you link your Spigot account in the #verification channel you could send images
I know, wasn't a bug report more answering cosmic about how it happens and how I go about getting around it for when I need the event to only fire once
Perhaps there's a reason it fires twice which would allow you to have a better solution then the very non-thread safe sounding solution of attaching a timer to your listener
I created a spigotmc account in a few seconds and I am now verified!
Gaming.
Strange, upon debugging the issue doesn't happen anymore and I have no idea why
Commented out my timer so it has no bearing on the code
Hi, I kinda need help with ProtocolLib. I'm listening to PacketType.Play.Server.BLOCK_BREAK_ANIMATION packets but how do I get the position? https://wiki.vg/Protocol#Block_Break_Animation
getBlockPositions or smth
don't answer if you don't know, thanks
Im trying to use protocolLib to send packets to edit the player's "over head" nametag. Does anyone know how to actually edit the packet for that? ```java
PacketContainer packet = protocolManager.createPacket(PacketType.Play.Server.PLAYER_INFO);
packet.set // where im trying to edit packet
try {
protocolManager.sendServerPacket(p, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}```
What? Why cant i just point you to the right direction? Cant you use your brain a little bit?
https://ci.dmulloy2.net/job/ProtocolLib/javadoc/com/comphenix/protocol/events/AbstractStructure.html#getBlockPositionModifier()
declaration: package: com.comphenix.protocol.events, class: AbstractStructure
file = new File(plugin.getDataFolder(), name + ".json");
public <T> T getJsonValue(Class<T> clazz) {
try {
return mapper.readValue(file, clazz);
} catch (IOException e) {
return null;
}
}
so I have this method in my JsonManager class and when i start the server it starts correctly and creates json file, writes values etc
but once i restart again after first creation of json file, it clears it on next startup
anyone got any idea why?
why do people want to use json when the API has a huge yaml api
yaml is ugly
but once i restart again after first creation of json file, it clears it on next startup
Probably because you dont load the old data
there's built in gson tho
load. what do you mean exactly? how do I do that?
yaml is god
well youre just storing your new data without actual loading the old .json file
reading
well, If I had a choice i'd use yaml and get it over with But this is a project that i am requested to do using JSON ;-;
so i read on startup or?
presumably youre putting stuff in json for a reason
so presumably you want to actually do something with that json lol
i thought people used JSON in plugins to use it on websites
yes, but when i try to use that method it just simply clears the file out
note: im using the method on startup
because you're obviously writing to the file again
you have a write method somewhere and are probably calling it
also who knows what mapper is
you're not really providing much context
So why is having a option to auto update a bad idea?
mapper = new ObjectMapper();
file = new File(plugin.getDataFolder(), name + ".json");
writer = new FileWriter(file); // this had try catch but removed for space ;-;
public <T> T getJsonValue(Class<T> clazz) {
try {
return mapper.readValue(file, clazz);
} catch (IOException e) {
return null;
}
}
public <T> void setJsonValue(T t) {
try {
writer.write(mapper.writeValueAsString(t));
writer.flush();
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
this is my settter and getter
that code is trash
well yes, expected
i am pretty new at java
but is there a better way than the trash one?
nothing in it is correct
wait what
copy and pasta?
I would suggest familiarising yourself with the yaml config API to begin with https://bukkit.fandom.com/wiki/Configuration_API_Reference
The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...
i do not see anything that has something to do with json on that website
it is yaml
well I'm not teaching you json and don't have a tutorial handy
so you're on your own
why do you need json
i am asked to use it so
why are you asked to use it
why do you need json
"To make an api"
i need json because i am bored of yml and trying something new
also you can parse json to java class
you cant do that in yml
or at least i haven't tried it yet
declaration: package: org.bukkit.configuration.serialization, interface: ConfigurationSerializable
🤢
How can you inject a plugin from another plugin without the plugin that you injected showing?
don't know if that makes sense to yall but it does to me
What do you mean inject it? you want to add it to your plugin as a dependency?
Sounds like malware to me .-.
Well the way you phrased it before you edited your message, sounded a lot like what malware does.
Do you have an example of what you want to inject?
I want to inject a whole different plugin that is stored somewhere
You'd need to add it as a dependency to your plugin and compile it into your plugin
no
I can explain you via dm
I have a loader that download a plugin from a website and inject it via reflections to the server
Because its a private loader i have done
oh ok
That its what you are looking for?
yea
Allright let me search the code
It injects the classes and all so it can run without the actual plugin being there
Why would you need that
why wouldn't you
Because you can just load the plugin from the jar
Let say it download the jar (a normal JavaPlugin) and it load into the server. And then you can take out the loader
But i have realized it is not finished
Anyone know how to get changed / new packets through bungee?
I got this error https://media.discordapp.net/attachments/827844856688672817/929521251360309269/unknown.png
That oblise you to have the jar you want to load in the same directory
Or what do you need jtx?
Can you explain via dm
No like the loaders is kept there but the loader injects the classes and all
But the jar should be in the same directory or different?
the loader?
the jar you want to load
AHh yeah
So probably you want to do a custom loader
They are used for security reasons
That isn't rly safe
yea
If you know how to manage yes
not sure how I would go about injecting the classes and all
I can send a snipet
sure
from the code i dont know if it works
Hello, how to use scheduler properly? f.e. to wait some seconds or make a list of tasks
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
how do i convert a double to a string
String.valueOf()
Double.toString
Does anyone have an established class to allow for stacking items with different lores and to change that lore upon them stacking? Currently trying to do so with currency items and displaying the total worth in the lore. I'll be able to figure it out myself (but there are a lot of cases to cover!)
I would probably do the worth lore via packets
why
How to check whether the citizen NPC can see the block? ( for example chest to open )
Hey, i have a problem, I must implement methods but... how can i make that? x() from entity insetient clashes with x() in entity living. (its nms 1.18.1) both methods have different return types, how is this possible? (implement methods do nothing D:)
when i join
it is supposed to load the chunk im in
so
in the chunkload event
will the chunk.getEntities contains me?
Hey people. Please i need help
Since i sent the message today. I cannot solve why i cant take the items from the menu. And it doesnt execute the action i have assigned
Make sure you're using buildtools with the remapped flag
java -jar BuildTools.jar --rev 1.18.1 --remapped
sure not, should that fix the problem?
It'll remap everything so it's readable and should fix the issue
https://paste.md-5.net/giyasiwiwu.java -> that the code. Please help!!!
hmm, still, i must do sth in Intellij?
Are you using maven?
yeah
Can I see your pom?
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>```
https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/ follow the instructions here to set up your pom
I don't see anything wrong there, but mostly I was asking if you had the net.md-5 plugin set up
ok i will do it tomorrow and let you know, thanks anyway for your help.
im trying to make a simple command
my plugin.yml: https://paste.developerden.net/abodofewep.yaml
my DeconstructCommand.java: https://paste.developerden.net/hawajuviki.typescript
my Deconstructor.java: https://paste.developerden.net/imyzawisav.java
i get the following error: java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.hextanium.deconstructor.Deconstructor.getCommand(String)" is null
i've checked my plugin.yml for spelling errors but couldn't find any
Looks like you are doing it correctly. Try recompiling and uploading to the server again. Could just be a weird mismatch if you copy files quickly and reload directly after.
i have recompiled, stopped the server, made sure i put the new jar in the plugins directory, and started the server
i get the same error
i have made sure the new code is being compiled by deleting the old jar that was in the output directory and the recompiling
A couple more things to verify are, did you put the plugin in the right server folder? I've made that mistake before.
Have you verified the contents of your jar? Make sure the plugin.yml contains the commands.
freshly installed os, and i only have 1 server
and it is indeed in the right folder
ill check the contents of my jar now
1 second please
my jar file seems to have all the classes and it has the plugin.yml
Double check the contents of the plugin.yml that's in the jar?
oh
it hasn't updated
well actually
it's different from my plugin yml completely
name: Deconstructor
version: '1.0-SNAPSHOT'
main: me.hextanium.deconstructor.Deconstructor
api-version: 1.18
authors: [ Hextanium ]
description: A plugin that deconstructs tools to their raw material based on their durability.
im building artifacts with intellji
Oh, well I was going to suggest checking your resource filtering parameters with maven, but I'm not too sure about artifacts.
i just realized where my mistake was
i already had a plugin.yml in the resources directory that i didn't see beforehand
my plugin.yml is the one in root
aaand it works now\
im sorry for wasting all of your times with my stupidity 😭
thank you all for helping!
is there an easy way to use a custom object in a yml file
Getting some sort of weird bug here.... Currently trying to debug inventory click event actions and it seems that when I am in my own (player) inventory, no chest or external inventory open, every event action is PLACE_ALL, however if I open a chest the actions are correct, any ideas?
ConfigurationSerializable
A good example?
implement ConfigurationSerializable then make 2 methods call serialize and deserialize
in the serialize method return a map<string, string>
for example a location
x: 123
y: 12
z: 123```
i think i forgot to put the class in
but who cares
in the map it should be like
map.put("x", 123)
map.put("y", 12)
map.put("z", 123)
or just this.x, this.y, this.z
about deserialize
i forgot
dunno go see location class
It's begun.
I added a redirect for it
Although redirects don't work great with Namecheap tbh
so it's actually libs.maow.xyz
I'm slowly starting to realize that URL redirects are dumb
Yup
Any difference between InventoryInteractEvent and InventoryClickEvent?
Because my inventory gui is having 2 problems. 1- It let me move/take out the button from the inventory. 2- The action on my buttons never get executed. Here is the source code. https://paste.md-5.net/giyasiwiwu.java
so I have both of those done, I just don't know where to call the deserialize method. I'm currently saving a hashmap with the custom object inside of it, so I'm not sure how/when I'm supposed to deserialize it
the deserialize will call right after you take that from the yml, bukkit handles it for you, you only need to retrieve it
i think like take it with a list
maybe'
then put it in the object
this.x = the object x
the deserialize method isn't part of implements ConfigurationSerializable
well, beacause the implementation is serialize only, i forgot that to implement it you only need the serialize method
I just saw a hole filler mod on youtube, and finally understood the real difference between cave air and air.
You can't listen to InventoryInteractEvent
inventoryinteract is a abstract i think?
yes
Oh allright. But any idea of why my code doesnt work?
Cause you can't have static interfaces in java
You should have the method anyway, or a constructor that takes a map
The javadocs should state this
Thanks. But its the same. It doesnt work my inventory api. I wanna cry. Code: https://paste.md-5.net/giyasiwiwu.java
okay, thank you
any ideas on how I should serialize this?
what is it
Material
It's an object in the hashmap that I'm saving
So should I just put String as the object and convert to a material where I need to?
you can make a custom serializable
Then I would have to create a custom object, yes?
is it the normal Material
?
yes
How can I get a player to spawn in the place he died?
event.getEntity().getLocation()
Map<UUID, Location>
if the player leaves remove them from the map
when they respawn set their location to the stored location
Hi I'd like to have cross-server support for one of my plugins. In particular, I would need to receive/broadcast data among my servers. Is a custom plugin messaging channel the right way to go?
[11:44:25] [Timer-11/WARN]: Exception in thread "Timer-11" java.lang.IllegalStateException: Asynchronous player kick!
[11:44:25] [Timer-11/WARN]: at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:14)
[11:44:25] [Timer-11/WARN]: at org.bukkit.craftbukkit.v1_18_R1.entity.CraftPlayer.kickPlayer(CraftPlayer.java:346)
[11:44:25] [Timer-11/WARN]: at handle.post.Post(post.java:102)
[11:44:25] [Timer-11/WARN]: at Spigot_ExpTech_whes1015.whes1015.DataUpdate(whes1015.java:236)
[11:44:25] [Timer-11/WARN]: at handle.timer.run(timer.java:11)
[11:44:25] [Timer-11/WARN]: at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
[11:44:25] [Timer-11/WARN]: at java.base/java.util.TimerThread.run(Timer.java:516)
Don't kick players async
public static void kickplayer(String player){
Objects.requireNonNull(Bukkit.getPlayer(player)).kickPlayer("\u6578\u64da\u7570\u5e38\u8acb\u91cd\u65b0\u52a0\u5165\u4f3a\u670d\u5668");
}
Is this async?
And where are you calling that
That's probably async
you'll need to do the HTTP request in async and then do the kick in sync
How can I do kick in sync?
Bukkit#getScheduler#runTask
Plugin plugin=Bukkit.getPluginManager().getPlugin("Spigot-ExpTech");
Bukkit.getScheduler().runTask(plugin,kickplayer(jsonObject.get("response").getAsString()));
😣
Plugin plugin=Bukkit.getPluginManager().getPlugin("Spigot-ExpTech");
assert plugin != null;
Bukkit.getScheduler().runTask(plugin, Objects.requireNonNull(kickplayer(jsonObject.get("response").getAsString())));
public static Runnable kickplayer(String player){ Objects.requireNonNull(Bukkit.getPlayer(player)).kickPlayer("\u6578\u64da\u7570\u5e38\u8acb\u91cd\u65b0\u52a0\u5165\u4f3a\u670d\u5668");
return null;
}
why is deserialize unable to be called?
public static Mine deserialize(Map<String, Object> decrypt){
HashMap<Material, Double> deserializedMap = new HashMap<>();
HashMap<String, Double> serializedMap = (HashMap<String, Double>) decrypt.get("mine");
serializedMap.forEach((a, b) -> deserializedMap.put(Material.getMaterial(a), b));
return new Mine(deserializedMap, (String) decrypt.get("name"), new Location(Bukkit.getWorld((String) decrypt.get("world")), ((double) decrypt.get("x1")), (double) decrypt.get("y1"), (double) decrypt.get("z1")), new Location(Bukkit.getWorld((String) decrypt.get("world")), (double) decrypt.get("x2"), (double) decrypt.get("y2"), (double) decrypt.get("z2")));
}
so it appears the problem has been found, just not a fix. the deserialize method is being called before the plugin load event which is breaking my custom config since the custom config is loaded in the plugin load event
Its not possible to create an interface or abstract class with static methods? Why?
updated error:
and after this is like 30 errors of the 2nd screenshot
Whats Mines line 34
It is possible.
wait
ObjConfig line 17*
my bad
which goes back to my issue of the deserialize method being called before I can initialize the config where it's being deserialized
Your issue is that YamlCOnfiguration.loadConfiguration(); is returning null
oh
Then make it be called after you initialize the config...
sir
bukkit itself is calling my deserialize method before the onEnable method
Why...
I have received a genius idea
I don't have a good reason
...
no custom emojis
yes
too late
Here's a solution:
Don't use YAML. Ever.
not really
configs only exception
aaand this is when I'll be leaving
Look up jackson Json
i mean if you dont want help then ig thats your problem
I have already been helped, thank you
then what else do you suggest you use as a human readable file system?
hi there
I'm back again
putting the initialize method in the deserialize method didn't work
Im not helping you
Hexic dragon
- Dont refuse helpful advice and then proceed to ask for help
- Dont use yaml for data storage
- Idk im, salty
bet
legit using json will solve all your problems
hello sir I'm not here to argue. the reason I said 'this is when I leave' is because I didn't want to waste your time when I wasn't going to redo my storage system for my personal plugin
sometimes its ok to accept defeat after working for hours
just use json or smthng
And btw
@lethal coral
https://www.baeldung.com/jackson
Python can still read XML faster than YAML.
Its so incredibly easy to use
Eh I prefer Gson over Jackson.
i never looked into gson
It's faster (Jackson is one of the slowest Java JSON libs) and easier to use, also Minecraft imports it.
wdym imports it?
help please
@EventHandler
public void onPunch(PlayerInteractEvent event) {
Player player = event.getPlayer();
c1.giveItem(player);
this is my code to add the custom item when i punch but it doesn' t give me ItemStack with meta
ItemStack item = new ItemStack(Material.WOOD_PICKAXE, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GRAY + "Wooden Hammer");
ArrayList<String> lore = new ArrayList<>();
lore.add("hammer!");
meta.setLore(lore);
player.getInventory().addItem(item);
item.setItemMeta(meta);
}
this is my customitem
So.... Anyone know how I could make a custom loader?
it only give me normal wooden pickaxe
Oh yeah this is a great anti-YAML article btw
https://hitchdev.com/strictyaml/why/implicit-typing-removed/
You add the item before setting the meta
The Norway Problem
how to fix this
ok thank
It has a dependency on it.
NO!!
So like
Gson is used in a lot of places in Minecraft
I dont have to add gson as a dependency?
Yep
Wait but is it a class deserializer like jackson?
Yes
Hmmmm
new Gson().fromJson(reader, MyClass.class)
If you can convert this
package me.silentprogram.betterbounties.jacksondata;
import com.fasterxml.jackson.databind.ObjectMapper;
import me.silentprogram.betterbounties.BetterBounties;
import me.silentprogram.betterbounties.jacksondata.files.Data;
import java.io.File;
import java.io.IOException;
public class DataManager {
Data config;
BetterBounties plugin;
File configFile;
ObjectMapper om = new ObjectMapper();
public DataManager(BetterBounties plugin){
this.plugin = plugin;
configFile = new File(plugin.getDataFolder(), "data.json");
}
public Data initializeConfig() {
try {
if (!configFile.exists()) {
om.writeValue(configFile, new Data());
}
config = om.readValue(configFile, Data.class);
} catch (IOException e) {
e.printStackTrace();
}
return config;
}
public void saveConfig(){
try{
om.writeValue(configFile, config);
}catch (IOException e){
e.printStackTrace();
}
}
public Data getConfig() {
return config;
}
}
Into Gson then ill switch over
wdym?
I probably cant help cause that sounds complicated
But
What?
You mean a custom plugin loader or classloader or what?
ik im like. wat
It loads classes from another jar
Look into jar IO and classloaders, you'll figure it out quickly.
trying to make it so the plugin isnt actually shown and its just the loader
I've done it before, e.g. https://github.com/MaowImpl/crow
not too hard, tbh
here's one out of many ways: https://www.concretepage.com/java/custom-classloader-java-example
I'm planning on rewriting this to also add Maven resolution support so you can essentially download Java apps like you would with apt
@SuppressWarnings({ "deprecation", "unlikely-arg-type" })
public void onBlockBreak(BlockBreakEvent event) {
Block b = event.getBlock();
Player player = (Player) event.getPlayer();
World world = player.getWorld();
Block block = event.getBlock();
if (b.getType() == Material.COBBLESTONE) {
player.sendMessage("break cobblestone");
if (player.getItemInHand().equals(c1)) {
player.sendMessage("da dung c1 dap cobblestone");
ItemStack is = new ItemStack(Material.QUARTZ, 4);
event.setDropItems(false);
block.getDrops(is).clear();
world.dropItemNaturally(event.getBlock().getLocation(), is);
}
}
}
hello i want to make custom item by Itemstack to break cobblestone drop quatz but not working can some one help?
actually, isn't just easier to put the given jar into the class path?
?paste
yes
please
thank you
Help
no
That defeats the purpose
@night patrol join the thread
what's the purpose?
aready join
Yeah it stops being drag-and-drop
so the jar can't be decompiled
jars are meant to hold compiled class files, which can be always decompiled
All the files are gonna be held in a web server
perhaps you're trying to load your classes directly using a custom classloader instead of holding them in a jar
right
Lol
So then someone decompiling will just download them off the webserver
Stop wasting time and energy on thsi
You can’t post such a plugin to SpigotMC,org anyway
What makes you think they won't
I mean of course they can but it won't be easy for them
as long they have the knowledge to be able to bypass it then they can
otherwise they can't
Or they can just dump all loaded classes with a 3 line java agent
is the plugin meant to be public?
no and yes
do you make custom plugins, like, for people?
no
then I don't really see it worth the effort tbh, there will be a delay whenever you're getting the information from the web server when you (try to) load a class
That's fine
well I hope you at least make something cool 😄
so should I still be looking at this? https://www.concretepage.com/java/custom-classloader-java-example
At the end of the day it's experience
Yeah very laggy
well, you can, it shows very easily how to create a custom ClassLoader
It would be very easy for them
however, that's not the same as implementing it
right I understand that
which in plataforms like bukkit is a pretty big headache
Alright, so if you understand that the barrier for entry on getting the class files is next to nothing, then why are you insistent on doing it?
how is it next to nothing
I could download and compile this right now in less than 20 seconds and then start dumping classes
go for it
Granted, this would only be able to dump loaded classes
To sum it up: Quit it.
Just compiled it
Nope, but it is a stupid choice to make
Oh yeah you could modify the original plugin to dump the bytecode of the classes it loads.
This would get everything, which would be nice ^
I'm one of those guys which likes to try new (mostly crazy) stuff things. Just to test. So I'd say him to go for it. Will be useless, mostly, but you will learn new things in the process
Definitely less
He can totally experiment, it's just a terrible idea for production.
And in RE for the Java Agent dumper: meh, you can already do that with or without his implementation and yet, you will need to manage to run it on his machines
I hope he's not doing that on production
Managing to run it on his machines isn't hard
do you have access?
One could get it
ok so, can you do the same for hypixel or cubecraft, and get their commercial secrets as well?
anyways, fighting for that is pointless lol
I think you got my point
Yes, but with substantially larger repercussions
public Mine(HashMap<Material, Double> chancepermat, String name, Location point1, Location point2, Boolean bool){
this.mine = chancepermat;
this.name = name;
this.x1 = (int) point1.getX();
this.y1 = (int) point1.getY();
this.z1 = (int) point1.getZ();
this.x2 = (int) point2.getX();
this.y2 = (int) point2.getY();
this.z2 = (int) point2.getZ();
this.world = point1.getWorld().getName();
this.box = new BoundingBox(x1, y1, z1, x2, y2, z2);
for(Map.Entry<Material, Double> entry : this.mine.entrySet()){
this.tree.put(this.count, entry.getKey());
this.count += entry.getValue();
}
}
public Mine(HashMap<Material, Double> chancepermat, String name, Location point1, Location point2){
new Mine(chancepermat, name, point1, point2, true);
Mines.addMine(name, this);
}
is this allowed? because when I do this this.mine returns null
(when I use the 2nd public Mine)
new Mine(chancepermat, name, point1, point2, true); ->
this(chancepermat, name, point1, point2, true);
Fixed it, thank you!
can having a lot of async bukkit tasks cause lag? (a sync task scheduled to place blocks over another block)
nah bro my epic loader is on top
Yes, it can. Context switch between threads is expensive
have one task that does all of them
and look into NMS for crazy amounta of efficiency
😐 and breaking every version
How can I stop my plugin from running without any errors in console?
I tried this but it didn't work:
getServer().getPluginManager().disablePlugin(this);
ah wait it could be because I didnt return give me one second
Yeah I fixed it, I accidently had it so that it wouldn't return thats all fixed now 😄
Bro Grief Prevention Plugin Trust Not Working. How can i Fix That??
i have no clue
Hey does anyone know how to register an economy plugin to vault?
Hello
does anyone have a plugin to link a minecraft UUID to a website with /link ingame?
i can pay for it
"to a website" is very generic. What exactly do you mean by that? Like the way Enjin websites do it?
Unless you're forking out major cash for it I imagine most people just use Enjin.
I'm not sure the amount of website devs that work spigot but you can always make a request on the forums https://www.spigotmc.org/forums/hiring-developers.55/
Ask the developer of the plugin
oh hm
You cant place blocks from another thread. Best you can do is split the workload over several ticks.
Better for what?
idk just started using Queue some time ago ... now i see there is Deque too
Sorry should've given a bit more info, I want to hook my economy plugin I made into vault. So far it works with vault just doesn't get known as a economy plugin for vault
Dequeue is just a double ended queue. So basically a Queue you can use in both directions
oh interesting ^^
Did you register a service provider?
man your good at tutorials ^^ now you need to write a tutorial for ChunkGenerator too
Yeah I did this:
public void hook() {
Economy provider = plugin.economyImplementer;
Bukkit.getServicesManager().register(Economy.class, provider, plugin, ServicePriority.Highest);
Bukkit.getLogger().info((plugin.utils.chatColor("&a&lSUCCESS: VaultAPI hooked into &b"+plugin.getName())));
}
The weird thing is my plugin shows up in the Economy section when I type /vault-info but other plugins can't access it with
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
because if I'm not mistaken that is what makes plugins able to use the registered economy, so I'm not too sure what's happening
hi
ItemStack item = new ItemStack(Material.WOOD_PICKAXE, 1);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.GRAY + "Wooden Hammer");
ArrayList<String> lore = new ArrayList<>();
lore.add("hammer!");
meta.setLore(lore);
item.setItemMeta(meta);
if (player.getItemInHand().equals(item)) {
player.sendMessage("da dung c1 dap cobblestone");
ItemStack is = new ItemStack(Material.QUARTZ, 4);
event.setDropItems(false);
block.getDrops(is).clear();
world.dropItemNaturally(event.getBlock().getLocation(), is);
}```
i have created item stack a new pickaxe everyworking well but when If the pickaxe has decreased durability, it is no longer available euals item how to fix this
... on top of a pile of crap xd xd xd xd xd
😔
Gaming!
Maybe create your own equals method?
All I can think is using ItemStack#isSimiliar but that only ignores the amount, so it won't work.
Or you can use PDC
Oh my god I'm dumb, the plugin that I was trying to make was loading after the plugin that needs the economy setup
thank but i aready using check lore/name metmod it working
pdc is definetly better
I mean does it matter?
it does
noonan
if a player goes offline, is the player object obtained when the players was online still valid when the player comes back online later``
no
ah great
It becomes invalid even after player Death
move to spong
ok it doesnt suck that much
i dont think this is true somehow O.o
what would be the best way to format seconds to HH:mm:ss without having to frick around with timezones
i need it to display a duration of something, not an actual time
You could use String.format(); and format it h : m : s or however you like
I mean why not use the date/time format api from Java
You can just use the root locale I believe
spigot provides apache so you can just do this:
long timeInMillis = 10000;
boolean padWithZeros = true;
String formatted = DurationFormatUtils.formatDuration(timeInMillis, "[H:mm:ss]", padWithZeros);
or
long timeInMillis = Duration.of(5, ChronoUnit.MINUTES).toMillis();
boolean padWithZeros = true;
String formatted = DurationFormatUtils.formatDuration(timeInMillis, "[H:mm:ss]", padWithZeros);
hello
how to make a block replace like when we put the grass block near the dirt block then dirt block change to grass?
- Listen for the BlockPlaceEvent
- Check if placed Block is of type GRASS_BLOCK
- Make 3 nested for loops regarding x, y and z
- Get all relative Blocks to the placed Block
- Replace every relative Block of type DIRT
Do you want the grass to also spread further into every possible dirt block after that?
do you get an example i am so noob
Live game objects should never be held in memory beyond their natural lifecycle.
First show me what you got so far
Ask specific questions if you have problems with one of the steps
i think i have a problem with stept 3
Block middleBlock = ...;
for (int deltaX = -3; deltaX <= 3; deltaX++) {
for (int deltaY = -3; deltaY <= 3; deltaY++) {
for (int deltaZ = -3; deltaZ <= 3; deltaZ++) {
Block relativeBlock = middleBlock.getRelative(deltaX, deltaY, deltaZ);
}
}
}
This gets all Blocks around the middle Block with a radius of 3
Don’t believe Apache is shaded any longer
thank you so much
How can I use bukkit.dispatchcommand and get response to output?
You need to implement the CommandSender interface
bukkit runnable?
I dont see the correlation... Is that a question?
How do I register CommandSender class?
You dont need to register it anywhere.
Simply let your implementation dispatch the command.
That's prob wrong
Why is there player.isAlive() then
Also it's valid even when he leaves, and rejoins iirc
I'm not sure but it doesn't make sense if what i said is false
Every time a player joins he gets a new instance of Player.
Oh
But like if I store a variable of a player by getting his uuis
Uuid*
It'll always be valid
Right?
I got this in my Command Sender: https://sourceb.in/gWJUP7T3us
And this is my main class: https://srcb.in/IpM8Vxc1rO
Sure the UUID never changes for a player
how to Get all relative Blocks to the placed Block ?
CommandEvent customSender = new CommandEvent();
Bukkit.dispatchCommand(customSender, "help");
thx
With the nested for loops
- Listen for the BlockPlaceEvent
- Check if placed Block is of type GRASS_BLOCK
- Make 3 nested for loops regarding x, y and z
- Get all relative Blocks to the placed Block
- Replace every relative Block of type DIRT
can you help me for example please
He means "can you help me with an example please?"
Look at the code sample ive shown you.
The middle block is the one that got placed in the event.
Now you just need to check the type for each relative block
and replace it if its a dirt block
Hey , what is the event for a player feeding an animal?
Probably PlayerInteractEvent and/or PlayerInteractAtEntityEvent
If you want to detect breeding of two entities listen for the EntityBreedEvent
okok
How i contact with him
dunno
go on their spigot page
why would you ask us that question?
this is NOT for server admin
#help-server instead
me who's doing it for 1.8 :kekw:

would be slaughtered for saying that in paper
Well even spigotists aren't all too happy about 1.8
I’m running a plugin I made on a 1.17 server running on my laptop. Every time it enables the plugin, it gives me some err about legacy stuff. Idk if it thinks my plugin for legacy versions or what, but I didn’t do anything that would make my plugin “legacy”
yeah but the agression level that "1.8" causes is very different
make sure you've got api-version: 1.17 in your plugin.yml
Oh, thx
The server was specifically 1.17.1 so would i put 1.17.1? I tried that but it said it wasnt valid
How can i use ${project.version} in my plugin.yml?
Can someone tell me how would be the code to appear a message in the chat when someone breaks a certain block?
BlockBreakEvent
yes i'm using that but i just want it to happen with diamond ore, just that
learn api
Check If the broken Block was Diamond ore
literally ${project.version}
Than when the Plugin ist loaded IT Displays ${plugin.versiob} as version
Yes IT IS specified
like this? @EventHandler
public void BlockBreakEvent(Block DIAMOND_ORE, Player player) {
then how did you write it in your plugin.yml?
no
brr
Version: ${project.version}
then how did you specify in your project properties?
thx for your help guys
pom.xml?
yes
No problem
Hi, When PluginDisableEvent triggers Bukkit removes a plugin object from plugins array. Does it mean plugin object and objects used in plugin will be deleted from memory by Java garbage collector?
<version>1.0</version>
I don't have the answer to your question, but what did you do to get your plugin marked in the / vault-info? I've been trying to make it appear for several days but I can't do it
then idk
Ok but thanks anyway
is chestcommands part of your plugin?
then you should see whther chestcommands provides the event for opening their guis
on bungee, when is the best to send a plugin message on join
what's a good formula for fortune
On join event? LoL
When the player Object is accessible
@wicked lake hi, i have one question about that nms, it works with mojang remapped, but should i always use mojang remapped nms when i use them?
now i have PathfinderMob instead entityCreature, is it good?
Without mojang mapped i had some problems, likw this #help-development message
Yeah
Wrong channel
wow sorry!!
I am setting an item in an inventory. when i create a new itemstack of, say, stone it works. but when i get the itemstack with a method i made, the slot just turns to air (the inventory was filled with glass). this is strange because i know that it is not material.AIR nor null
This is the code:
public void open(DeliveryPlayer player){
Inventory inv = Bukkit.createInventory(null, rows * 9, ChatUtils.translate(title, player.getPlayer()));
for (int i = 0; i < inv.getSize(); i++) inv.setItem(i, fillIs);
rewardSlot.forEach((rewardName, slot) -> {
Reward r = RewardManager.getInstance().getReward(rewardName);
System.out.println(r.id);
if (r == null) System.out.println("REWARD IS NULL!");
ItemStack is = r.getItemByPlayer(player);
System.out.println(is.getType().name()); // prints the material name just fine
inv.setItem(slot, is); // sets the slot to air for some reason
});
viewers.put(player.getPlayer(), inv);
player.getPlayer().openInventory(inv);
System.out.println("Opening menu!");
}
``` for the menu opening
and for getting the item:
public ItemStack getItemByPlayer(DeliveryPlayer player){
ClaimableState state = player.getClaimableState(this);
if (state == ClaimableState.AVAILABLE){
ItemStack is = new ItemStack(Material.GREEN_STAINED_GLASS);
is.setAmount(claimableAmount);
ItemMeta meta = is.getItemMeta();
meta.setLore(ChatUtils.translateAll(player.getPlayer(), claimableLore));
meta.setDisplayName(ChatUtils.translate(claimableDisplayName, player.getPlayer()));
is.setItemMeta(meta);
return is;
}else if (state == ClaimableState.ALREADY_CLAIMED){
long secs = this.cooldown - (System.currentTimeMillis() * 1000);
long p1 = secs % 60;
long p2 = secs / 60;
long p3 = p2 % 60;
p2 = p2 / 60;
String seconds = p2 + ":" + p3 + ":" + p1;
//{claim_next_remain}
ItemStack is = new ItemStack(Material.RED_STAINED_GLASS);
is.setAmount(claimedAmount);
ItemMeta meta = is.getItemMeta();
ArrayList<String> parsed = new ArrayList<>();
for (String s : claimedLore) parsed.add(s.replace("{claim_next_remain}", seconds));
meta.setLore(ChatUtils.translateAll(player.getPlayer(), parsed));
meta.setDisplayName(ChatUtils.translate(claimedDisplayName.replace("{claim_next_remain}", seconds), player.getPlayer()));
is.setItemMeta(meta);
return is;
}else{
ItemStack is = new ItemStack(Material.STONE);
is.setAmount(notAvailableAmount);
ItemMeta meta = is.getItemMeta();
meta.setLore(ChatUtils.translateAll(player.getPlayer(), notAvailableLore));
meta.setDisplayName(ChatUtils.translate(notAvailableDisplayName, player.getPlayer()));
is.setItemMeta(meta);
return is;
}
}
Is it possible to fix it without mappings?
Yes but not easy
Why do you want to avoid mappings
Is the amount 0?
appearantly it was, but it was not in the config..
but ya, i fixed it now i guess
Thanks for wanting to help tough :)
Hello!
I've got a quick couple of questions:
Does anyone know if a player uses a smithing table; does the game play the sound BLOCK_SMITHING_TABLE_USE or does it play the effect SMITHING_TABLE_USE, or does it play both?
And does it play these for only the player that uses the table or does it play it for the world (so everyone near can hear it)?
Then I'm also wondering what's the difference between a sound and an effect and I'm wondering if there is an easy way to find things like this out by myself (like is it possible to look at the source code to find this out quickly and how would I go about doing this)
hello, is there anyway to change the CHAT tab completion ?
im trying to code a nickname plugin
1.8.8
I don't want to avoid mapping, it's the first time I see it and I'm curious.
Does anyone know how to specify gradle installation path on IntelliJ IDEA project? For some reason I'm not using Gradle version 7.0+ even tho I installed Gradle 7.2 and confirm it too by using gradle -v command.
@glossy marsh effects can be both sounds and particles
it’s mostly reading/testing to figure out which is which
@quaint mantle no
@summer scroll might be in your project settings?
Can't find it.
So an effect can contain a sound?
1.8 not 1.13+
How would I go about doing this? Write a listener that prints the effect/sound to me?
declaration: package: org.bukkit, enum: Effect
You could try using the /playsound command to listen to each one
if it isn’t possible in 1.16 it definitely wouldn’t be possible in 1.8
no
i was reading the forums
Thank you so much
Bruh
I don’t get people like you
Can I do X?
No
Yes I can, someone said so
Why tf do you come in asking if you can do it if you already know
hi, i need to get all classes loaded in my plugin, is some more clear way than that?
xy?
What are you trying to do
get all classes that i use in my plugin project
?xy
Asking about your attempted solution rather than your actual problem
Why would you want it
for finding all classes that use custom my addnotations
Anw with mappings the difference is only in the names? @chrome beacon
Annotations you mean? What does your annotation do
yes Annotations, but what they does it's not the case
Yes mappings only change names
Maybe it is possible without fucking your classloader no?
sorry for ping though
so where can i find changed names? I mean which name corresponds to which
MiniMappingViewer
and 1.18.1?
Spigot -> Mojang is only up to 1.16.5
Mojang -> Spigot is up to 1.18.1
Actually nvm it's broken
Use what manya said
For some reason this code just times out the server at the Thread#sleep call.
Can someone explain why this is happening?
It only triggers once
and yes, the block-decay.time config field is set
lemme try something
Hello,
I'm running spigot + bungeecord:
Bungee Server
|-> Lobby
| |-> MyPlugin
|-> Server1
|
Now i want to redirect users in my Lobby to Server1 (e.g. with a gui).
My current code:
if(e.getRawSlot() == 3){
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BELL,0.2f,1.2f);
// Redirect Player p to Server1
}
Of course it does
It freezes the server thread for said amount of time
?scheduling is the way to go
alr ty
i didnt read the docs right
so Bukkit.getScheduler().runTaskLater(callback, time) right
Myes
nvm its with plugin as the first param
what version ?
Create a Location and use Location#setWorld on it
and set the first param to your world
make sure the parameter is a World and not the name of the world
ehh world = port?
then use Player#teleport and pass in the Location instance
or the name from the bungee config?
the world is for example world as the default name of the overworld
i run bungeecord
world_nether for the nether
@modern vigil and what's the name of a new Server?
wym
Bungee Server
|-> Lobby
| |-> MyPlugin
|-> Server1
|
i want to connect to server1
ok
Hello,
I'm running spigot + bungeecord:
Bungee Server
|-> Lobby
| |-> MyPlugin
|-> Server1
|
Now i want to redirect users in my Lobby to Server1 (e.g. with a gui).
My current code:
if(e.getRawSlot() == 3){
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BELL,0.2f,1.2f);
// Redirect Player p to Server1
}
Use plugin messaging
also
What's the event for a grass block turning into dirt when a block is above it
I've tried multiple ones but they don't seem to work
dont like that page ^^
why?
does not contain everything at 1 page 😄
currently only applies to liquid (lava and water) and teleporting dragon eggs
maybe have u got any other page?
(but for me works good, i need only names of classes)
then the solution is "BlockFadeEvent"
well... not perfect but i used to code the page my self since i wanted to know the variables and so on too: https://timcloud.ddns.net/mapping/1.18.1/
you can wait for the page to finish load and use the searchbox on the top-left ... also easy to use "Single Class" to get a static page of only that class for later to use faster
oo, I think you sent it to me yesterday as I remember correctly when checking the entity.
could be true
thank you!
How long can a string from the Scoreboard Team prefix be?
Iirc it is unlimited in 1.18
How to cancel blocks getting removed from an explosion?
oh great
imma do a scoreboard lib then