#help-archived
1 messages Β· Page 57 of 1
Is the problem serialize or deserialize?
deserialize
okay this line
import itemstack
1.15
and click on it
import net.minecraft.server.v1_15_R1.ItemStack;
click on the line u ss?
click on itemstack part
Your ide should open destination class.
I don't tinker with NMS that much unfortunately
you should
why f and g are "byte" notwithstanding they correspond to the yaw and pitch that are float ? So I get IllegalArgumentException
The server sank into deep inactivity..
I've never tried to use as a byte but I don't think you get IllegalArgumentException
Caused by: java.lang.IllegalArgumentException: Can not set byte field net.minecraft.server.v1_12_R1.PacketPlayOutNamedEntitySpawn.f to java.lang.Float
So you can get it xD
:')
Just use headrotation packet
what about casting to byte
Right, you're passing it a float?
I'm just creating a DataWatcher, I don't want to create a packet rotationhead
but sometimes it's not actually fixed yaw and pitch
so you should use another packet for fixing it
Yeah I think i'll do that Fr33
yeah, can't send a byte field a float lmao
because the computer says so
Hey
-_-
How to use placeholders?
that's why you should learn why there are sizes
@chrome edge stack trace doesn't lie 
@frigid ember if it's correct why there's another packet for settings yaw and pitch. It looks ugly tho
@cold wharf you've should plugin's wiki.
if you're using plugin for that
i think the other one is for the movement blackone
@chrome edge I am making plugin
I mean look at it how ugly it is;
new PacketPlayOutEntityHeadRotation(entity, y);```
And I want to use other plugin's placeholder
I've no experience about other plugin's api and placeholder things...
Then google it
MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer();
WorldServer nmsWorld = ((CraftWorld) Bukkit.getWorld("world")).getHandle();
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "Β§aΒ§l" + npcName);
EntityPlayer npc = new EntityPlayer(nmsServer, nmsWorld, gameProfile, new PlayerInteractManager(nmsWorld));
Player npcPlayer = npc.getBukkitEntity().getPlayer();
npcPlayer.setPlayerListName("");
npc.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
PacketPlayOutNamedEntitySpawn d = new PacketPlayOutNamedEntitySpawn(npc);
DataWatcher w = new DataWatcher(null);
w.register(new DataWatcherObject<>(13,DataWatcherRegistry.a),(byte)127);
setValue(d, "a", 55);
setValue(d, "b", npc.getUniqueID());
setValue(d, "c", npc.locX);
setValue(d, "d", npc.locY);
setValue(d, "e", npc.locZ);
setValue(d, "f", (byte) npc.yaw);
setValue(d, "g", (byte) npc.pitch);
setValue(d, "h", w);
PlayerConnection connection = ((CraftPlayer) player).getHandle().playerConnection;
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, npc));
connection.sendPacket(d);
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, npc));```
Well,
well what
in every version the logic is changed
no way you can do it viaversion 1.8.8 to 1.15
=)
I want to log into the git page of spigot but i don't know what credentials, I tryed with the forum ones but they didn't work
did you tried md5@spigotmc.org and password 12345? π€
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Damn you guys got serious with contributions
uuuhm, the cla is like 5 years old?
Thatβs been there for ages π
π€
I haven't seen anything related to Spigot contributions ever. Last time I even thought about it was back in the bukkit days π
I am getting Caused by: java.util.UnknownFormatConversionException: Conversion = 'l' does anyone know how i can fix it?
@EventHandler
public void onChat(AsyncPlayerChatEvent e) {
Player player = e.getPlayer();
String swapPlayer = plugin.chatFormat.replace("%player%", player.getName());
String swapMessage = swapPlayer.replace("%message%", e.getMessage());
String swapPlaceholders = PlaceholderAPI.setPlaceholders(player, swapMessage);
String colourSwap = ChatColor.translateAlternateColorCodes('&', swapPlaceholders);
e.setFormat(colourSwap);
}
Can someone explain me how work WorldGuard region priority?
I set one region with mob-damage allow and priority 2 and set another one region inside with priority 1, set on this region mob-damage deny and it isn't working
mobs can still give damage
the higher the number, the higher the priority
Just swap priorities
do note though, since you have 2 regions with 2 opposite flags, that if a player is a member of the region with mob damage allow, it will allow mob damage for that player
I the CLA under JIRA account you should put the username of jira?
@chrome edge I tried :
for (Entity entity : Bukkit.getWorld("world").getEntities().stream().map(xx -> ((CraftEntity) xx).getHandle()).collect(Collectors.toList())){
if (entity.getId() == mobID){
if (entity instanceof EntityPlayer){
StaticNPC staticNPC = manager.convertEntity((EntityPlayer) entity);
player.sendMessage(" ok" );
}
}
}```
that should check for every nms entity if it has the same ID. But it doesn't work ;-;
Make a class that containt NPC information. Whenever you create NPC save npc's id into its class.
when you click to entity, check ids in NPC classes. If it's equal clicked mob's id, reurtn NPC class
Can i enable hoppers on worldguard region without enabling chest-access?
I think it's not the place ask question about spigot plugins.
You've should ask to world guard discord or github
Driven crazy
@lament wolf haven't you fixed yet?
ok, sorry
I know I can, but I've been at it for six hours without a break. I can't do a single loop anymore
:relieved:
after understanding how it works, you can edit as your needs
is it possible to issue a set permission coommand on issue of a nomrla command
@versed forge What do you mean? Like do make a command that uses a permissions plugins set permission command? Just make an alias for the set permission command.
@versed forge what exactly do you want?
what i mena so when they do /is it give them a diffrent scoreboard with featherboard
Anyone know how you can execute a bungee command from the spigot console?
so it gives them the permission node for that sscoreboard
@versed forge Make an alias command that runs both the set permission command and the /is command
@narrow carbon As I know, it's not possible but there're alternative methods to execute bungee command from bukkit console. Use message channels and send command data to bungee. Listen command from bungee and execute.
So I would have to write a custom plugin?
Yeah, a plugin that interacts with both bungee and Spigot. Otherwise it's not really possible.
Welp, since I'm pretty new to java IG I'm up for a challange x)
x) Good luck haha. I haven't even begun to dabble in the Bungee API yet.
It shouldn't be too hard, will require a spigot plugin and bungee plugin
Both just need to communicate using proxy channels
any crates plugin 1.15.2
https://www.spigotmc.org/search/187643044/?q=crates&t=resource_update&o=relevance
pretty sure you could have done this yourself
I have a question, how long does it take for a premium plugin to be reviewed?
~3 weeks
Anyone know how you can execute a bungee command from the spigot console?
I think I found an already existing plugin to do this for me.
I'm going to test this:
https://www.spigotmc.org/resources/commandsync.115/
@narrow carbon pretty sure that just executes on multiple spigot server across bungee
~3 weeks? So much?
Third line of the usage:
/sync console bungee alert Wassup! would make the console of the BungeeCord server run the command alert Wassup!
I think this does it :3
I'm going to test it
Maybe then π€·
I'll post it here if it works π
crate plugin simple for 1.15 works fine, thanks
I think I found an already existing plugin to do this for me.
I'm going to test this:
https://www.spigotmc.org/resources/commandsync.115/
Doesn't function, wich is party not suprising sins the last update was in 2013
@frigid ember you say that this shouldn't be too hard, yet I don't know where to start.
Can you redirect me to some documentation or smth bc's I can't seem to find it :3
@narrow carbon take a look at https://github.com/games647/CommandForward you should be able to find your way :p
I'll take a look, thanks.
Oo excuse me
Are you looking for a plot plugin?
Plots to my minecraft server
ahhh
Yes
i love when people do that
i'll make a loved free plugin, i'll stop updating so they're forced to used the premium version π
Some people decide they don't want to work for free anymore
and that's fine
I haven't released a plugin to any market in years lmao
Hmm, is there a way to get the SpigotWorldConfig when using the API? I didn't realise the world-settings in the config were per world but I can't seem to find a method to get the settings for each world with the API.
does ram clock matter in running a server ?
ram clock or ram cock?
On a serious note, not really
might see a small improvement but not anything worth while unless you've got 100s of players constantly
any plugin devoloper contact me pls
?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.
Good enough to act as a inventory config saver? ```@EventHandler
public void closeEvent(InventoryCloseEvent e){
itemStackList.clear();
if(e.getInventory().equals(lootTableInventory)){
pl.getloottablecfg().set("LootTables."+name,null);
for(int x=0;x<=53;x++){
if(lootTableInventory.getItem(x)!=null){
itemStackList.put(x,lootTableInventory.getItem(x));
pl.getloottablecfg().set("LootTables."+name+"."+x,lootTableInventory.getItem(x));
}
}
pl.saveloottable();
e.getPlayer().sendMessage(ChatColor.GREEN+"[HuntingGrounds] "+ChatColor.GRAY+"Succsessfully saved the loottable!");
return;
}
}```
Does what is supposed to
If it works, it works
Where is a blocks position anchor point? Not center, right?
I mean, when I get the location, is that the center of the block or a corner?
Hmm okay. Thank you.
Hmm, is there a way to get the SpigotWorldConfig when using the API? I didn't realise the world-settings in the config were per world but I can't seem to find a method to get the settings for each world with the API.
@crimson sandal Anyone have any clue if the api can do this without manually reading the config for per world values?
for(int x=0;x<=53;x++){
inventory.size(). Don't assume inventory size. Make this future proof
its hardcoded to 54 though
It may not be one day
Think forward
It's a minor change that may save you some bug fixing down the line
also size-1 right?
Just < size() is fine
thanks
Other than that, looks fine to me. ItemStacks are configuration serializable
yeah i love that
Yeah that's really handy, I use that in my plugin to save custom inventories
C:\Users\dimit\Desktop\Backup>java -Xmx15G -jar spigot.jar nogui
Error, this build is outdated
Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot
Server will start in 20 seconds
Loading libraries, please wait...
[22:12:06] [Server thread/INFO]: Starting minecraft server version 1.15
[22:12:06] [Server thread/INFO]: Loading properties
[22:12:06] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-f39a89e-4633e6c (MC: 1.15) (Implementing API version 1.15-R0.1-SNAPSHOT)
[22:12:06] [Server thread/INFO]: Debug logging is disabled
[22:12:06] [Server thread/INFO]: Server Ping Player Sample Count: 12
[22:12:06] [Server thread/INFO]: Using 4 threads for Netty based IO
[22:12:06] [Server thread/INFO]: Default game type: SURVIVAL
[22:12:06] [Server thread/INFO]: Generating keypair
[22:12:06] [Server thread/INFO]: Starting Minecraft server on 192.168.0.2:25565
[22:12:06] [Server thread/INFO]: Using default channel type
[22:12:07] [Server thread/WARN]: ** FAILED TO BIND TO PORT!
[22:12:07] [Server thread/WARN]: The exception was: java.net.BindException: Cannot assign requested address: bind
[22:12:07] [Server thread/WARN]: Perhaps a server is already running on that port?
[22:12:07] [Server thread/INFO]: Stopping server
[22:12:07] [Server thread/INFO]: Saving players
[22:12:07] [Server thread/INFO]: Saving worlds
C:\Users\dimit\Desktop\Backup>pause
Press any key to continue . . .
What do i do
i moved my computer and then it stopped working
Perhaps a server is already running on that port?
Task manager is your best friend
you didnt close the previous server
Are there anybody who using Redis/Jedis?
You will have a Java instance in task manager thats still running
ok
Either reboot/log out or find it in task manager
log out of what
Of Windows, it's easy enough to find it in Task manager though
what is the file called
sable lmao
If you do:
FileConfiguraiton config = getConfig();
ConfiguraitonSection section = config.getConfigurationSection("section");
section.set("abc", 123);
saveConfig();
Will it update the configuration?
Yes
Thanks, wasn't sure if it was a clone or not
@chrome edge It's an unnecessary mention, but it works, after a week and dozens of hours of research. Thank you
Hello π with gradle ? How I can get a plugin on my computer ?
anyone familiar with MyChunk 3
its used on a server im modded in and we're trying to raise the number of chunks people can claim
C:\Users\dimit\Desktop\Backup>java -Xmx15G -jar spigot.jar nogui
Error, this build is outdated
Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot
Server will start in 20 seconds
Loading libraries, please wait...
[22:12:06] [Server thread/INFO]: Starting minecraft server version 1.15
[22:12:06] [Server thread/INFO]: Loading properties
[22:12:06] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-f39a89e-4633e6c (MC: 1.15) (Implementing API version 1.15-R0.1-SNAPSHOT)
[22:12:06] [Server thread/INFO]: Debug logging is disabled
[22:12:06] [Server thread/INFO]: Server Ping Player Sample Count: 12
[22:12:06] [Server thread/INFO]: Using 4 threads for Netty based IO
[22:12:06] [Server thread/INFO]: Default game type: SURVIVAL
[22:12:06] [Server thread/INFO]: Generating keypair
[22:12:06] [Server thread/INFO]: Starting Minecraft server on 192.168.0.2:25565
[22:12:06] [Server thread/INFO]: Using default channel type
[22:12:07] [Server thread/WARN]: ** FAILED TO BIND TO PORT!
[22:12:07] [Server thread/WARN]: The exception was: java.net.BindException: Cannot assign requested address: bind
[22:12:07] [Server thread/WARN]: Perhaps a server is already running on that port?
[22:12:07] [Server thread/INFO]: Stopping server
[22:12:07] [Server thread/INFO]: Saving players
[22:12:07] [Server thread/INFO]: Saving worlds
C:\Users\dimit\Desktop\Backup>pause
Press any key to continue . . .
What do i do
i moved my computer and then it stopped working i have looked through task manger nothing is open i dont have any other serverws on mc pc what do i do
Port is already in use.
Make sure you don't have any other instances running on port 25565
how can i check that
Okay open up the cmd prompt
yep
netstat -aon | findstr '[port_number]'
iirc
It should show which application is using the port
do i put 25565 in the [port number
yes
nothing came up
try switch the port number in properties to something else
wym
like if i change the port on the server it shouldnt effect portfowarding of it
C:\Users\dimit\Desktop\Backup>java -Xmx15G -jar spigot.jar nogui
*** Error, this build is outdated ***
*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***
*** Server will start in 20 seconds ***
Loading libraries, please wait...
[00:33:29] [Server thread/INFO]: Starting minecraft server version 1.15
[00:33:29] [Server thread/INFO]: Loading properties
[00:33:30] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-f39a89e-4633e6c (MC: 1.15) (Implementing API version 1.15-R0.1-SNAPSHOT)
[00:33:30] [Server thread/INFO]: Debug logging is disabled
[00:33:30] [Server thread/INFO]: Server Ping Player Sample Count: 12
[00:33:30] [Server thread/INFO]: Using 4 threads for Netty based IO
[00:33:30] [Server thread/INFO]: Default game type: SURVIVAL
[00:33:30] [Server thread/INFO]: Generating keypair
[00:33:30] [Server thread/INFO]: Starting Minecraft server on 192.168.0.2:25566
[00:33:30] [Server thread/INFO]: Using default channel type
[00:33:31] [Server thread/WARN]: **** FAILED TO BIND TO PORT!
[00:33:31] [Server thread/WARN]: The exception was: java.net.BindException: Cannot assign requested address: bind
[00:33:31] [Server thread/WARN]: Perhaps a server is already running on that port?
[00:33:31] [Server thread/INFO]: Stopping server
[00:33:31] [Server thread/INFO]: Saving players
[00:33:31] [Server thread/INFO]: Saving worlds
C:\Users\dimit\Desktop\Backup>pause
Press any key to continue . . .
thats what it says now
uh that's weird
move your pc?
i unpluged my pc and moved it as i was cleaning my desk
*desktop pc
and now it doesnt work
what do i do
You haven't assigned any specific ip address to the server props?
You might have to remanage the domain
Yeah I mean update the ip it's redirecting to
Why would this throw bound negative? public ItemStack returnItem(){ Random rnd = new Random(); return itemStackList.get(rnd.nextInt(itemStackList.size()-1)); } every time after i edit the list ```@EventHandler
public void closeEvent(InventoryCloseEvent e){
itemStackList.clear();
if(e.getInventory().equals(lootTableInventory)){
pl.getloottablecfg().set("LootTables."+name,null);
for(int x=0;x<lootTableInventory.getSize()-1;x++){
if(lootTableInventory.getItem(x)!=null){
itemStackList.put(x,lootTableInventory.getItem(x));
pl.getloottablecfg().set("LootTables."+name+"."+x,lootTableInventory.getItem(x));
}
}
pl.saveloottable();
e.getPlayer().sendMessage(ChatColor.GREEN+"[HuntingGrounds] "+ChatColor.GRAY+"Succsessfully saved the loottable!");
}
}```
Yeah. Maybe your ip changed because you moved idk 
lmao
nooo i have to re do everything
Yeah that's poopy
argggggg
@vernal spruce can you send the stacktrace?
at java.util.Random.nextInt(Unknown Source) ~[?:1.8.0_231]
at me.Stellrow.HuntingGrounds.LootTable.LootTable.returnItem(LootTable.java:51) ~[?:?]
even though i have like 6 items
in there
public ItemStack returnItem(){
Random rnd = new Random();
return itemStackList.get(rnd.nextInt(itemStackList.size()-1));
}
-1
Well, first of all, have 1 random instance.
But I mean return itemStackList.get(rnd.nextInt(itemStackList.size())); this should work fine
same stuff hmm
With a configurationsection can you get a value by its path? Like ```
ticks-per:
hopper-transfer: 8
Hi there any ideas how to extract folder from jar?
.getInt("ticks-per/hopper-transfer")
@unkempt dock WinRar
Hi there any ideas how to extract folder from jar?
@unkempt dock open it in winrar
like in Java
@vernal spruce if it's empty it would return the Exc
Random#nextInt doesn't like integers under 1
strange im saving a total of 6 items... in the hashmap
itemStackList.put(x,lootTableInventory.getItem(x))
Well try debug the size when invoking the method returnItem
yep jumps to 0
With a configurationsection can you get a value by its path? Like ```
ticks-per:
hopper-transfer: 8
@crimson sandal yes you would have to get the key of the config section and then get value by the path.
while it jumps to zero the other methods keeps working perfectly even after the edit
lootTableInventory.clear();
for(Integer i : itemStackList.keySet()){
lootTableInventory.setItem(i,itemStackList.get(i));
}
p.openInventory(lootTableInventory);
}```
This still works after that
Can you put everything in a bin
found the problem..
itemStackList.clear(); was outside the if statement for inventory saving
it was clearing it without being it..
well.. beside the messy command system the plugin is kinda ready for what i expected it to do
Do somebody know how to do it?
I need to extract folder from a jar. However, when the jar is obfuscated the path changes
lol
I need it in java -.-
yeah kinda took me 5 secs to type it π
and in what category
I was even on 2nd page
is the link i sent you?
so instead of reading the "solution marked reply"
you went to the 2nd answer?
problem
But should we use FileSystem zip or ZipInputStream π€
cuz
this works only on windows
yah im using filesytem but the problem is
final URI resource = SimplePlugin.class.getClassLoader().getResource("").toURI();
I need to extract folder from a jar. However, when the jar is obfuscated the path changes
π Don't π ob π fus π cate π
You're making your own life more difficult, you're making that of your users more difficult and you're going against the entire purpose of Bukkit - free and open source
well said choco
@crimson sandal yes you would have to get the key of the config section and then get value by the path.
@naive goblet I'm trying .getInt("ticks-per/hopper-transfer") but that's not working, what's the correct format or is that not possible?
If I have to say it over a thousand times, it gets said better and better each and every time. I also hate saying it more each time I have to, but y'know
yeah we should make a command for it choco
BuT iF i DoNt FuScAtE mY cOdE mAy GeT sToLeN
Damn I remembered there being one
they might have removed it
It should say "Stop disrespecting Bukkit you ass hole >:(("
I agree with you on that choco let get it added
You're making your own life more difficult, you're making that of your users more difficult and you're going against the entire purpose of Bukkit - free and open source
Thats why a project a few friends of mine and I were walking on switched to public repos for everything - itβs the entire point of the community... collaboration, support & open source
Its just basic tbh everyone helps everyone in this commnity
thats just what being a part of a community is
But iTs tO mAkE mOnEy nOt bE a cOmMuNiTy
Thatβs what I had said to me when I asked why someone was making stuff obfuscated π
Money is good.
Just doing it for money and not because you like the community is eh
dont get me wrong i would love to have some spare money rnπ
@frigid ember /reload ?
I have utf-8 set in maven and on the config file, but my symbol comes out with a funny looking a.
It's not possible. You have to stop to server.
How?
@remote socket May I see your maven?
<?xml version="1.0" encoding="UTF-8"?> In the start of the maven, you can set encoding.
Which iso do you use?
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
also have that
Have you try to run with sh start.sh
nope
@remote socket I couldn't see any problem from your maven
Is still shows weird character instead of utf-8?
Which IDE do you use?
Try to export with your IDE not maven.
So is it work?
have u made it executable
You export from your IDE. If it didn't work, probably causing ide
Intellij just sounds like a pain in the arse
everyone just seems to have issues with it π€·
Actually everyone who doesn't know how to use ide have problem with intellij xD
They jump notepad++ to intellij
Of course it's normal to hear problem from them
yo
how did md_5 get the snapshot in the bukkit form?
NP++ to an actual IDE shouldn't be an issue lmao
I've been using Eclipse for almost 6 years. IJ still bothers me
^
It's preference
Notepad++ is everything for me ._.
where do you get the bukkit/spigot snapshot?
Tleer, md is the maintainer. He has tools to update the software. Snapshot builds are not public
rip.\
You shouldn't be seeking them either. They're not stable builds of the game
Wait until a pre-release
but he runs a server on it lol
...
So that when it is released, you DON'T have bugs
just get a plugin for that
If & doesn't work (can't recall off the top of my head), yea, section symbol
Yes.
Same as with &
@subtle blade when is the release of 1.16
1.16 Will break colors right?
@frigid ember that's probably a question for mojang lol
true
Well iirc it comes with that you can choose any color ?
You can use custom colors but we don't know how that will fit into the API
As colors previously were an enum which represents set values and don't allow for modification
I can't wait to mess around with the api
So it will require some sort of rework of the system
when is the release of 1.16
Yea I'm not Mojang ;P We don't know that
Spigot's releases are generally pretty quick. A day or two after that of Mojangs
Sometimes within a few hours
At the earliest we might see a spigot pre release mirroring a mojang one
that's not to say we will 100% get one, that's up to md if he feels spigot is ready enough for that
where do u reporty bugs at
?jira
so don't go spamming the man saying "when prerelease. mojang did theirs 37 seconds ago"
Ensure you're on latest and that bugs are not present on vanilla
36 secs late? REE
xD
Had to type that bugger out lol
Those are for bugs found on the #spigotcraft server
If you have a vanilla bug, send it over to Mojang's tracker, https://bugs.mojang.com
yeah they already fixed a lot of bugs in the recent snap
this is quite a basic java question im sorry
I have a method called purgeDrops() which removes blocks, it returns a int.
If i want to print the int i can do
System.out.println(purgeDrops());
but is that the right way to do it?
it executes the method just fine right?
yea but i mean, will it execute the method just fine?
It should.
anyone that can confirm ?:D
Of course it'll work.
well unless theirs error in your code.
But if you get error in method the return will not work
okay thanks
you can dupe Items?>
?
nice
System.out.println(purgeDrops());
That will work fine, yes. Though worth noting it won't work for something likeplayer.sendMessage(purgeDrops())only because it accepts a String, unlike println() which accepts an Object
You'd have to stringify the result. player.sendMessage(String.valueOf(purgeDrops()))
How can i stop peoplepulling items out of a GUi
How do i check the last block, making an anticheat and i need to it from false flaging with someone jumping on ice and getting off ice
Cancel the events
?
cancel the inventory click event
Cancel the events for them being able to pull the stuff out
thanks @chrome edge
p.getLocation().getX()
How do i check the last block, making an anticheat and i need to it from false flaging with someone jumping on ice and getting off ice
Just store the last location?
and get it that way
or what do you mean?
PlayerMoveEvent e.getFrom()?
@frigid ember You may save player's location that has on ground. Whenever gets true flag, teleport the player to saved location.
I donβt wanna teleport I just want to stop flagging then
Becaue if they jump from a ice block they go faster
So itβs passing the threshold
Use PlayerMoveEvent to listen, and use PlayerMoveEvent#getFrom().getBlock() to get the last block, to stop it, cancel the event.
Ah didnβt know I can getFrom then the block
#getFrom().clone().subtract(0,1,0) to get the block under the player
hi im using the screaming bed wars plugin and i was wondering how to enable leather armor and wooden sword to always spawn with you?
Oh, sh works!
@frigid ember Just to add to this (sorry for v late response) it may be that you created the file with sudo and then are generally running it, try chmod'ing the file π
@light folio this is not the place you can ask spigot plugins help
Try to find their discord server or just pm to creator of plugin
@dark shuttle no need to clone every time
Use block getRelative
If you're trying to get the block underneath
it will get the block twice isnt it? the block on player's location and then block under it
what is the right way to get a offlineplayer
OfflinePlayer target = Bukkit.getOfflinePlayer(args[0]);
this is deprecated according to my ide
that's how I always do it, I think it's good
Deprecated because (1) Will cause an API request to Mojang which may be blocking and (2) Names are not meant to be used as persistent data
So if you want to get by name, that's the way to do it, but don't store names as persistent data if that's your reason for getting them
Resetting Spigot-Server to CraftBukkit...
fatal: ambiguous argument 'origin/patched': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Applying patches to Spigot-Server...
Applying: POM Changes
Applying: Skeleton API Implementations
Applying: mc-dev imports
Applying: Spigot Configuration
error: sha1 information is lacking or useless (src/main/java/net/minecraft/server/DedicatedServer.java).
error: could not build fake ancestor
Patch failed at 0004 Spigot Configuration
``` I'm getting this error when trying to applyPatches the Spigot project, not sure what I've done wrong
Hello, I am making a MC server and I have noticed that when my players (premium players) change their usernames; everything they have earned and saved like /bal /home etc is gone. The server treats their user as a brand new player, with a brand new welcome message. What is the reason for it?
Hey guys, when I open a gui for the player when clicking on a fake player, when i click on the fake player it opens a gui, but when i click in the gui it doesn't do anything, but if i open the gui from a command I can click on items and it works
ProtocolLibrary.getProtocolManager()
.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.USE_ENTITY) {
@Override
public void onPacketReceiving(PacketEvent event) {
if (event.getPacketType() == PacketType.Play.Client.USE_ENTITY) {
try {
Player p = event.getPlayer();
PacketContainer packet = event.getPacket();
int id = packet.getIntegers().read(0);
int stats = npcStats.getId(p);
int unranked = npcStats.getId(p, true);
int ranked = npcStats.getId(p, false);
if (id == ranked) {
p.openInventory(Methods.duelGUI());
}
} catch (Exception e) {
}
How can I keep the credentials such as /home and /bal of users when they change their username?
Hello. I was wondering if someone could help me with some really basic stuff, just installing a plugin or two and getting everything to work fine. Willing to PayPal someone a few dollars. Please let me know if anyone can help
|| event.getFrom().clone().subtract(0, 1, 0).getBlock().getType().equals(Material.ICE)
|| event.getFrom().clone().subtract(0, 1, 0).getBlock().getType().equals(Material.PACKED_ICE)
``` i have this but i jump around land on a normal block and it flags?
"Legacy plugin v1.01 does not specify an api-version." I currently made a plugin with eclipse from scratch and I am getting this on console.
if you only want to support MC 1.13.2+ you need to specify api-version: <the version you built with> in the plugin.yml
otherwise ignore it
@lyric badge What do you need help with?
How do I install a plugin LOL
@neat orbit Whatever plugin you're using is saving their data via username instead of UUID
Just drag and drop into the plugins folder
event.getFrom().clone().subtract(0, 1, 0).getBlock().getType()
Just call this once and hold it in a variable, please. Don't call things more than you need to
the individual .jar files?
Yes
-- Anyone know why this kit says "That kit is improperly defined"?
Most plugins are drag and drop anyways, you might need dependencies for some but those should be listed on the plugin's page if applicable.
What's the difference between white-list and enforece-whitelist
Surround that string with ''
i.e. - 'diamond_pickaxe 1 DIG_SPEED:12 ...'
so on and so forth
Looks like enforce-whitelist will kick people if they're on the server and not on the whitelist
Whereas just turning on white-list won't actually kick them
So what exactly does just white-list do then lol
white-list prevents people from joining if they're not on the list.
Oh okay
Ok i am doing ```java
Material e = event.getFrom().clone().subtract(0, 1, 0).getBlock().getType();
|| e.equals(Material.ICE)
|| e.equals(Material.PACKED_ICE)) { return; }
And it stills flags.
Do == instead of equals()
Don't you want if it's NOT equal to those?
Hey guys, when I open a gui for the player when clicking on a fake player, when i click on the fake player it opens a gui, but when i click in the gui it doesn't do anything, but if i open the gui from a command I can click on items and it works
ProtocolLibrary.getProtocolManager()
.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.USE_ENTITY) {
@Override
public void onPacketReceiving(PacketEvent event) {
if (event.getPacketType() == PacketType.Play.Client.USE_ENTITY) {
try {
Player p = event.getPlayer();
PacketContainer packet = event.getPacket();
int id = packet.getIntegers().read(0);
int stats = npcStats.getId(p);
int unranked = npcStats.getId(p, true);
int ranked = npcStats.getId(p, false);
if (id == ranked) {
p.openInventory(Methods.duelGUI());
}
} catch (Exception e) {
}
.equals will work fine, it's the lack of an if statement
In this case, if it is ice or packed ice, it will return
if statement cut off maybe? Surely it's there
yes i want it to return if they are because if they double jump and go to a different block it flags them (so i want to stop the false flag)
But it doesnt return when i jump of the block to fast
Does getOfflinePlayer(uuid) ping Mojang API also?
Or only in the circumstance that the player hasn't played recently (or always)
I currently use it when opening a coinflip menu to get the head ..
and give money to the winner
https://gyazo.com/9019d57ac10e955fc4792e4794644ed8 heres what it does
Idk how you're checking speed, but that's doing what it should. They're velocity is still higher coming OFF of the ice, so it's flagging
want me to send how i am checking?
float threshold = p.isOnGround() ? 0.31f : .341f;
float deltaXZ = (float) Math.sqrt(Math.pow(event.getTo().getX() - event.getFrom().getX(), 2) + Math.pow(event.getTo().getZ() - event.getFrom().getZ(), 2)), deltaY = (float) (event.getTo().getY() - event.getFrom().getY());
threshold += data.slimeTicks > 0 ? 0.07f : 0;
threshold += PlayerUtils.getPotionEffectLevel(event.getPlayer(), PotionEffectType.SPEED) * (p.isOnGround() ? 0.06f : 0.045f);
threshold *= data.onStairSlab ? 1.8f : 1.0;
threshold *= data.iceTicks > 0 && data.groundTicks < 6 ? 2.5f : 1.0;
threshold *= data.blockTicks > 0 && deltaY != 0 ? 2.0f : 1.0;
if (deltaXZ > threshold) {
if ((data.speedThreshold += 2) > 25) {
flag(event.getPlayer(), deltaXZ + ">-" + threshold);
data.speedThreshold = 0;
}
} else {
data.speedThreshold = Math.max(0, data.speedThreshold - 1);
}
}
``` Here.
Sure I suppose, but you could just not flag players who were recently on ice for a few seconds.
Yeah they're going over the speedThreshold
Do what I said, just don't flag anyone who has recently been on ice.
Do i do what i have been doing to get recently on ice?
? No. Check if they're on ice, if they are, add them to a HashSet<> or something. If they're in that HashSet don't flag them
Then remove them from the Set after like a second or something
Does anyone knows a guide to the best approach to store user data for a MMO with things like Citizen, Denizen?
pretty sure its not possible
Just have two subdomains... na and eu
Hey guys, do you know why inventoryclickevent isn't working when I open the gui after clicking a fake player? https://discordapp.com/channels/690411863766466590/690470011382267904/706212537208668211
probably just have NA and EU servers on the same bungee
Just connect all your servers to the same Bungee Proxy
@frigid ember It's possible the server doesn't know about the Inventory or something
What don't you understand?
Are you removing it
Can you show?
Material e = event.getFrom().clone().subtract(0, 1, 0).getBlock().getType();
Vector velocity = p.getVelocity();
long Time = System.currentTimeMillis();
long MS = System.currentTimeMillis() - Time;
if (MS > 10000L) playerIceCache.remove(event.getPlayer().getUniqueId());
//1.9 check for player.isGliding and in 1.13 check for player.isRiptiding().
if (event.getPlayer().getAllowFlight()
|| event.getPlayer().isInsideVehicle()
|| data.isVelocityTaken()
|| playerIceCache.containsKey(event.getPlayer().getUniqueId())) {
return;
}
if (event.getPlayer().getLocation().getBlock().getType() == Material.PACKED_ICE && !playerIceCache.containsKey(event.getPlayer().getUniqueId())) playerIceCache.put(event.getPlayer().getUniqueId(), event.getPlayer().getName());
float threshold = p.isOnGround() ? 0.31f : .341f;
float deltaXZ = (float) Math.sqrt(Math.pow(event.getTo().getX() - event.getFrom().getX(), 2) + Math.pow(event.getTo().getZ() - event.getFrom().getZ(), 2)), deltaY = (float) (event.getTo().getY() - event.getFrom().getY());
threshold += data.slimeTicks > 0 ? 0.07f : 0;
threshold += PlayerUtils.getPotionEffectLevel(event.getPlayer(), PotionEffectType.SPEED) * (p.isOnGround() ? 0.06f : 0.045f);
threshold *= data.onStairSlab ? 1.8f : 1.0;
threshold *= data.iceTicks > 0 && data.groundTicks < 6 ? 2.5f : 1.0;
threshold *= data.blockTicks > 0 && deltaY != 0 ? 2.0f : 1.0;
if (deltaXZ > threshold) {
if ((data.speedThreshold += 2) > 25) {
flag(event.getPlayer(), deltaXZ + ">-" + threshold);
data.speedThreshold = 0;
}
} else {
data.speedThreshold = Math.max(0, data.speedThreshold - 1);
}
}``` it prob wrong i aint used to making anticheats and checking blocks
Use
Bukkit.getScheduler().runTaskLater(() -> {
playerIceCache.remove(event.getPlayer().getUniqueID());
}, 60);
Not System.currentTimeMillis()
60 ticks
ah
Which is 3 seconds
it can't resolve method 'runTaskLater(Lamba expression)
You need the 60
i have it
Bukkit.getScheduler().runTaskLater(() -> {
playerIceCache.remove(event.getPlayer().getUniqueId());
}, 60);```
Oh you need the plugin, forgot. Put your plugin instance before the lambda
Yea, i think it works but it doesnt flag even if i havent stepped on ice
yea i am just testing with packed_ice
public class SpeedA extends Check {
public SpeedA(String name, CheckType type, boolean enabled, boolean punishable, int max) {
super(name, type, enabled, punishable, max);
}
private Map<UUID, String> playerIceCache;
final FileConfiguration config = AntiCheat.getInstance().getConfig();
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
DataPlayer data = AntiCheat.getInstance().getDataManager().getDataPlayer(event.getPlayer());
Entity p = (Entity) event.getPlayer();
Material e = event.getFrom().clone().subtract(0, 1, 0).getBlock().getType();
Vector velocity = p.getVelocity();
//1.9 check for player.isGliding and in 1.13 check for player.isRiptiding().
if (event.getPlayer().getAllowFlight()
|| event.getPlayer().isInsideVehicle()
|| data.isVelocityTaken()
|| playerIceCache.containsKey(event.getPlayer().getUniqueId())) {
return;
}
if (event.getPlayer().getLocation().getBlock().getType() == Material.PACKED_ICE && !playerIceCache.containsKey(event.getPlayer().getUniqueId())) playerIceCache.put(event.getPlayer().getUniqueId(), event.getPlayer().getName());
float threshold = p.isOnGround() ? 0.31f : .341f;
float deltaXZ = (float) Math.sqrt(Math.pow(event.getTo().getX() - event.getFrom().getX(), 2) + Math.pow(event.getTo().getZ() - event.getFrom().getZ(), 2)), deltaY = (float) (event.getTo().getY() - event.getFrom().getY());
threshold += data.slimeTicks > 0 ? 0.07f : 0;
threshold += PlayerUtils.getPotionEffectLevel(event.getPlayer(), PotionEffectType.SPEED) * (p.isOnGround() ? 0.06f : 0.045f);
threshold *= data.onStairSlab ? 1.8f : 1.0;
threshold *= data.iceTicks > 0 && data.groundTicks < 6 ? 2.5f : 1.0;
threshold *= data.blockTicks > 0 && deltaY != 0 ? 2.0f : 1.0;
if (deltaXZ > threshold) {
if ((data.speedThreshold += 2) > 25) {
flag(event.getPlayer(), deltaXZ + ">-" + threshold);
data.speedThreshold = 0;
}
} else {
data.speedThreshold = Math.max(0, data.speedThreshold - 1);
}
Bukkit.getScheduler().runTaskLater(AntiCheat.getInstance(), () -> {
playerIceCache.remove(event.getPlayer().getUniqueId());
}, 60);
}
}```
thats the whole class
The runTaskLater should be right after you put them into the Set
yea still errors
java.lang.NullPointerException
at me.l3ilkojr.gamingphone.checks.movement.SpeedA.lambda$onPlayerMove$0(SpeedA.java:42) ~[?:?]
at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftTask.run(CraftTask.java:71) ~[server.jar:git-GenericSpigot-5728a59]
at org.bukkit.craftbukkit.v1_7_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:341) [server.jar:git-GenericSpigot-5728a59]
at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:707) [server.jar:git-GenericSpigot-5728a59]
at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:309) [server.jar:git-GenericSpigot-5728a59]
at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:650) [server.jar:git-GenericSpigot-5728a59]
at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:555) [server.jar:git-GenericSpigot-5728a59]
at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [server.jar:git-GenericSpigot-5728a59]```
What's line 42 in SpeedA
hi guys i've been making a plugin theese couple days and after making the reload command and executing it it prompts an error, this is my code:
Whats the error
playerIceCache.remove(event.getPlayer().getUniqueId());```
Yeah reloadMessage is probably null
config.yml ^
i made a string
String reloadmessage = getConfig.getString("reload-message");
@verbal raptor sorry for the ping could you help me?
It's null, are you sure your config is generating?
yes
@Override
public void onEnable() {
getCommand("switcher").setExecutor(new Switcher());
File file = new File(getDataFolder(), "config.yml");
if (!file.exists()) {
//noinspection ResultOfMethodCallIgnored
getDataFolder().mkdirs();
saveResource("config.yml", false);
}
YamlConfiguration config = new YamlConfiguration();
try {
config.load(file);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
}
this.config = config;
}
@Override
public FileConfiguration getConfig() {
return config;
}```
if (!file.exists()) {
//noinspection ResultOfMethodCallIgnored
getDataFolder().mkdirs();
saveResource("config.yml", false);
}
the file already exists, so it's not saving anything
underneath that add
(undearneath this.config = config)
Shouldn't you just do saveDefaultConfig() ?
he could, but isn't
Shouldn't you just do
saveDefaultConfig()?
@upper hearth i want a custom config
anyway, config.options().copyDefaults(true);
that spigot does not just change
spigot doesn't just change it
yeah
under the hood spigot is doing pretty much the same code
wich one :_:
if (!file.exists()) { //noinspection ResultOfMethodCallIgnored getDataFolder().mkdirs(); saveResource("config.yml", false); }
@dusty topaz this?
just read ...
(undearneath this.config = config)
im not english sorry i am italian
does that affect your ability to read the code
a bit
:p
why don't you try it
ok
OOOOOOOOOOH thats why it gave error
its because i had the old config
i tought it would ovverride it if something had been changed
π€¦ββοΈ for me
hey guys,
iam using a Bungeesystem and its only pissible to connect to the Fallback (lobby)
i did the same on every server. in spigot and paper.yml bungge to true
hmm im having other problem @dusty topaz
like i reload the config and when i get the snowball it does not change the lore
do anyone knows what this could be
@upper hearth you know why my flag isnt working?
Anyone have experience with replacing NMS blocks? I've replaced a FenceGate with my own custom one, and replaced the Blocks static final, and the registery with my custom block. EVERYTHING works, but now the BlockPlaceEvent wont fire for that specific block... So I'm missed a registry somewhere most likely
So if I try to run BuildTools with a forked Bukkit & CraftBukkit repo I get this error ```
Caused by: org.eclipse.jgit.errors.TransportException: https://hub.spigotmc.org/stash/scm/~jameslfc19/bukkit.git: Authentication is required but no CredentialsProvider has been registered
Not sure if I should be running BuildTools with a forked repo but CraftBukkit has no origin/patched branch so ./applyPatches.sh isn't working either
well that's a new one for me
Yeah, it's very weird
Ok, so i am trying to make a check for SPEED on my anticheat i want it to stop false flagging speed when someone jumps on ice and it speeds them up and they land on a different type of block anyone know a why to stop this?
Check for the block?
Hello
The discord server is not what i expected..
What were you expecting? lol
Something bigger and sufficient
There is literally TextChannels and Voice Channels thats it
Anyway
usually discord servers have text channels and voice channels
Its fine
some staff i need help
im trying to verify my spigot account but an mail is not sends
@atomic rapids
plz help
i cant download plotsquared ^^
v.5

give them it on the bungeecord side of things, not spigot server side ^^
just wanted to clarify
as /server is a bungeecord permission
it needs to be given on bungeecord
I feel like im going insane my CraftBukkit repo doesn't have an 'origin/patched' branch and I'm getting this error when running ./applyPatches.sh in the Spigot module
And getting this error
fatal: ambiguous argument 'origin/patched': unknown revision or path not in the working tree.
Anyone got any ideas?
do u get any errors in your code?
idk :/
Is it possible to "reload" an Async scheduled task? I have it reading from a config file, and when I reload the config, the task doesn't reload its versions of the data
Is there a permission for copy NBT data?
i got plotsquared !!!! i dont think its gonna work but it does
does spigot have a support email
I have one question about singletons and lazy initialization getInstance() method, which of the two styles is preferred usually?
//First way
public static Class getInstance(){
if (instance == null) {
instance = new Class();
}
return instance;
}
// Second way
public static Class getInstance() {
instance = instance == null ? new Class() : instance;
return instance;
}
Does anyone know a sign chest shop plugin for 1.12?
@frigid ember store the task as a BukkitFuture, when you need to "reload" it, cancel the old task and make a new one
@sturdy oar Why would you need to check if it's null? It should already be created? The point in a singleton is you intialized it already and you only want one instance of that class.
It's a lazy singleton
It really doesn't matter which method you use. I prefer the first one, although with the addition of synchronized double-checked locking and a volatile reference, for thread safety purposes.
it's lazy instantiation exactly
I don't need to instantiate this specific class until someone needs it, eager instantiation would not make sense in my case
Hi
is it possible to get some support for ultra permissions here?
i have some "broken" ranks on my server that i cant click on
Does anyone have a minigame framework that I can use?
@sturdy oar Don't lazily instantiate
It's definitely unlikely that the object is so heavy that you need to lazily instantiate.
that's not the reason, it's not heavy at all
My apologies
I presumed based off of one of your later statements.
Why would you not created it until needed?
A good rule of thumb is to define everything as effectively final unless you absolutely need to.
oh to be fair I'm not making a plugin, it was just a general Java question
Yeah
I'm talking about Java.
Not specifically in regards to plugin development.
Unrelated, does anyone know if it's possible to expose the underlying ExecutorService that BukkitSceduler uses?
I was making this class which represents a connection manager, and I don't feel like it should be loaded if no connections are being made
that's why i choose lazy
Does it manage a single connection or multiple
many
not talking about sql
Minecraft clients connections π
Gotcha
I'm trying to learn how to move / make bots interact inside a server using packets
it's a fun project
Sounds like fun
Gl eh
Definitely try and stay away from lazy instantiation where possible.
If you can't, look into some cool things like Dependency Injection/Service pattern
https://github.com/Steveice10/MCProtocolLib this library saves my life to be honest
It has basically no documentation, but it's better than having to do all the packets by yourself
yeah of course
even implements RSA it looks like
Looks fairly actively maintained too
it also works for server π
Does World#spawnEntity call EntitySpawnEvent?
I think so
I'm trying to make an easy way to create custom enchants.
I'm extending the Enchantment class but I want to add new methods to each of the custom enchants by default. How should I go about this?
add new methods by default?
i mean
show your enchantment class and name the methods you mean
you could technically check the entity UID and ignore the event if it's the same one being summoned
not the best idea prob. tho
avro couldnt you just change event prio?
uhh, no?
okay
public TestEnchant(@NotNull NamespacedKey key) {
super(key);
// TODO Auto-generated constructor stub
}
@Override
public @NotNull String getName() {
// TODO Auto-generated method stub
return null;
}
@Override
public int getMaxLevel() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int getStartLevel() {
// TODO Auto-generated method stub
return 0;
}
@Override
public @NotNull EnchantmentTarget getItemTarget() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean isTreasure() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isCursed() {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean conflictsWith(@NotNull Enchantment other) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean canEnchantItem(@NotNull ItemStack item) {
// TODO Auto-generated method stub
return false;
}
}
These are all the methods that are automatically added to the class when you extend Enchantment. How can I add more methods to this?
you write them?
add abstract methods to Enchantment class
is there a way to automatically add them whenever i extend Enchantment in a class?
looking at source (though it's paper source), I can't see world#spawnEntity calling an event
nope, I found it
it does call event
if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
return false;
}
nvm i didnt solve it.
I want to be able to have methods automatically added just like all the other methods that are added whenever I extend Enchantment. Anyone have any idea how to do this? (and no i dont mean just write them)
i cant edit the enchantment class tho
then make another abstract class that extends Enchantment
add methods to that
and then extend that one instead
i'll try that, thanks
Is there a way to disable NametagEdit in certain worlds?
not that i know of
could write a plugin for it though
api would allow for something like that
The only reason why I'm asking is because it overrides a skywars plugin I use, which gives team colors in the tablist.
ah, in that case probably not
@EventHandler(priority = EventPriority.HIGHEST)
public void onSpawnEvent(SpawnerSpawnEvent event) {
int spawnerAmount = spawnerManager.getAmount(event.getSpawner().getLocation());
event.setCancelled(true);
Location location = event.getEntity().getLocation();
for (int i = 0; i < spawnerAmount; i++) {
for (int j = 0; j < ThreadLocalRandom.current().nextInt(3) + 1; j++) {
Bukkit.broadcastMessage("Spawning an entity of type: " + event.getEntityType());
spawn.add(location.getWorld().spawnEntity(location, event.getEntityType()).getUniqueId());
}
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onEntitySpawn(EntitySpawnEvent event) {
if (spawn.contains(event.getEntity().getUniqueId())) {
event.setCancelled(false);
}
}
that doesn't even work whaaattt
how doesnt it work
On my spigot server, the server is returning true for player.isFlying() when they're not and they're on the ground
hmm, so the entityspawnevent isn't called
@frigid ember does player.isOnGround() return true
yes
pretty sure player.isFlying() isn't related to it anyway
i think it's only set to false if they double tab space again
though not sure - actually i think im wrong with that
I'll admit its 1.8.8 and 1,906 versions behind
no clue why tbh
i'll just make a scheduler that'll set flying false if they're on ground both from their packet and util Β―_(γ)_/Β―
hey! a player says he keeps crashing and gets this error. could this be my server or the players client?
Client
Looks like they don't have enough ram allocated
Running out of graphic card memory?
Is his gpu above the minecraft minimum specs
Given it looks to be an older igpu it probably isnβt
We are 2020 and people still have memory problems :d
well because software feels like they have too much and they can extend over the actual needed memory
My intel platinum with 4gb could even run mc at 15 fps
I remember back in 2016 when I had a crappy laptop, and Optifine would boost my frames from 20 to 25. The good days.
hi
so i run a server.
I keep editing the MOTD and Resource Pack sections (hosting using MinePack and I changed the 'resource-pack-sha1' hash value as well)
but nothing changes.
Wdym?
my motd is stuck to "in Lobby" in green
i can';t change it for some reason
but if I boot my server using the "Minecraft 1_15_2" jar file which is Mojang;s official build then everything works fine
thats why im here
i think its either Spigot or one of the plugins.
MOTD of the Resource Pack keeps being "in Lobby" in green?
How would you allow a spawner to spawn mobs at all times of day (ie it cannot spawn enderman or zombies during the day)
(Programmatically)
the Resource Pack doesn't load
Provide screens if possible and what you are trying to proceed cuz I've no idea what you are doing
@dusty topaz Listen for CreatureSpawnEvent, check if the SpawnReason is SPAWNER then check for the world's time of day
is creasture spawn event cancelled automatically?
#Minecraft server properties
#Thu Apr 30 15:28:02 PDT 2020
spawn-protection=16
max-tick-time=60000
query.port=25565
generator-settings=
force-gamemode=false
allow-nether=true
enforce-whitelist=false
gamemode=survival
broadcast-console-to-ops=true
enable-query=false
player-idle-timeout=0
difficulty=hard
spawn-monsters=true
broadcast-rcon-to-ops=true
op-permission-level=4
pvp=true
snooper-enabled=true
level-type=default
hardcore=false
enable-command-block=true
max-players=64
network-compression-threshold=256
resource-pack-sha1=36ba223b364d6bdb60a8bef108fa836baba4d7aa
max-world-size=29999984
function-permission-level=2
rcon.port=25575
server-port=25565
debug=false
server-ip=192.168.0.102
spawn-npcs=true
allow-flight=true
level-name=spawn
view-distance=10
resource-pack=https://download.mc-packs.net/pack/36ba223b364d6bdb60a8bef108fa836baba4d7aa.zip
spawn-animals=true
white-list=false
rcon.password=
generate-structures=true
online-mode=false
max-build-height=256
level-seed=
use-native-transport=true
prevent-proxy-connections=false
motd=PMC87881caf0a6d8e05b8d1469413ca38e0
enable-rcon=false
jesus...
What do you mean cancelled automatically? No event is cancelled automatically unless manually called.
@severe hemlock Use a paste site next time, please.
?paste
then how would that solve spawning zombies from spawners during the daytime
You would need to cancel it yourself.
i don't want to cancel it
i want night mobs to be able to spawn during the day π
(and night)
(all mobs spawning anytime)
I mean, it wouldn't really be too big of a problem to paste it into discord either, it's just a lot easier on the eyes if you use the `(``) tags (without the ( ))
<stuff here>
like this?
What's wrong with ti
I mean, they should just work.
I really think the problem is you just aren't running Spigot.
If you're running Minecraft's server jar, you aren't using Spigot.
You run one or the other.
the plugins I use are:
AlwaysSpawn
BuildMoney v3.9
CKits v1.06
CrazyEnchantments v1.8-0
CustomItems
DeadChest-3.2
Dynmap-3.0-beta
EssentialsX
Dynmap-GriefProtection
Dynmap-WorldGuard-1.2
Dynmap-Essentials-0.9.1
EssentialsX
FogusCore
GoldenEnchants
GriefProtection
GWarp
InvSort 1.1.0
ItemEdit
KnokkoCore
LuckPerms-Bukkit-5.0.72
MoreArmors
Multiverse-Core-4.1.0
Multiverse-NetherPortals
Multiverse Portals
OpenInv
Parties 2.6.14
PetMaster
QuickShop 3.1.4.31
Shopkeepers 2.9.3
TrollBoss_v6.2
UHCRun-1.2
Vault
VeinMiner-1.15.0
WildTP
WorldEdit
WorldEdit SUI
WorldGuard
All of my plugins work
jesus
i am running the 'Spigot.jar' file
Whats the problem with doing:
ArrayList<UUID> players?
instead of:
List<UUID> players?
Nothing.
Why do people always say use List
is that alwaysspawn made by me? :p
if i run the minecraft_1.15.2.jar file then the Resource Pack works
other than that there shouldnt really be any difference.
and @tiny dagger pretty sure it is
:d
I personally use List<X> list = new ArrayList(); but I dont really see a reason not to go the other way around, unless you dont want to refer to array lists later on
So, you could theoretically create your own List class that implements List
and that could be a reason why you would want to use List over ArrayList, since ArrayList is just another class that interfaces off of List
How do I make a vargs? I forgot
Object ... args
So really, with that said; it's good practice to use List<UUID> list = new ArrayList(); over ArrayList<UUID> list = new ArrayList();
same vice versa, like Map<String, UUID> players = new HashMap();
Other than that, there's not really a difference, besides making your code better for future changes
this.spawn = spawn;
this.name = name;
for (Location checkpoint : checkpoints) {
this.checkpoints.add(checkpoint);
}
}```
It's just good to use the supertype.
Should I do that
also for players you should use a Set if possible as it is faster
Aight
and the same principle @dusky herald mentioned applies:
e.g. Set<UUID> players = new HashSet<>();
You should do this instead of
HashSet<UUID> players = new HashSet<>();
this is the liskov substitution principle
I did that
ah right
I always wondered what people meant by LSP
now you know π xD
lmao
How do I make my plugin not lag the server?
you're running the code at least as possible caching stuff that can be reused
You should be making calls to the Database Async anyways
But, whatever data you plan on using the most, and most frequently that probably doesnt ever change much should be cached when the plugin loads.
But what if its data that needs to be updated immediately, such as a players balance?
when I set my Resource Pack it doesn't work
on my server's server.properties file
MOTD doesn't work either
How do I change config to work with beds in Eggwars X? I have BED set in config I look at a bed and it just says you must look at a BED to set a teams bed no error is logs either. I would really appreciate your support on this.
this is the plugin
?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 not running on the main thread
anyone know how to fix the ENTITY_LIGHTNING sound effect for 1.8.9 clients on spigot 1.15.2 servers using protocolsupport? im custom coding a plugin and im not sure how to convert the newer sounds to the legacy sound
I know its possible with protocollib but idk where to start
@agile rock You load that information in when the player logs in, and cache it after they log in.
Keep it all Async, and just plan out when you load the data, so that its easily accessible later (so you arent waiting on database delays)
You can cache the data for players who are online and unload it when they log off.
and save their data on the fly
So save bal info every x minutes? Since if the servers crashes all the info is lost
You can save balance whenever it changes
Loading is just different because you may be relying on the delay, so you want it to happen ASAP, then there's no reason to load more data between then (for most purposes)
as for saving, keep it Async, and you can save data as you go
Rather than every X minutes, you can save when a player performs an action, the server won't be relying on data to return
any ideas?
My problem is 1.8.9 clients can't hear lightning sounds on 1.15.2 servers
@frigid ember Sorry, no clue bud.
mmm this is a toughy
might have to look into protocol lib and modify packets right on the spot
but even then that might not work
should probably just stop using 1.8 π
lol the problem is a lot of people still use 1.8
look at hypixel, almost all the youtubers use 1.8.9 to pvp
and i cant miss out on that 30-40% of players who still use it (just a guess off the top of my head)
Ok, so what should I make async? @dusky herald
....
How do I change config to work with beds in Eggwars X? I have BED set in config I look at a bed and it just says you must look at a BED to set a teams bed no error is logs either. I would really appreciate your support on this.
this is the plugin
https://www.spigotmc.org/resources/β¦-eggwars-bedwars-x-β¦-solo-teams-kits-trails-leaderboards-mysterybox-parties.42396/
1.7, 1.8 has better pvp than 1.9x
my server isnt running 1.8, its running 1.15.2 with protocolsupport. but the nabs who still use 1.8 can't hear lightning sound effects, which is a big problem
and i cant force people to update
Oh ok,
@agile rock Make everything that handles the database Async, lol
hey
does anyone here know how to make a custom map that combines
together
to form one large singular image?
using spigot of course...
hello?
@anyone
plz help
@strange grove use ImageOnMap's API?
plugin.getConfig().getList("some-list")
How can I make some-list into a string with newlines?
@frigid ember what do you mean by newlines?
list item 1
list item 2
So you want to put all items from a String list into a string?
nvm figured it out π