#help-archived
1 messages Β· Page 102 of 1
but the crash happens in 20 seconds
so I highly doubt sqlite is responsible for that in the first 20 seconds
@keen compass you realize host kernel is the one that manages process memory inside docker right?
I am aware, but how often do you see linux kernels causing segfaults? second if this was the host kernel you would think more customers would have been complaining and the hosting provider would have responded with more information other then the indication they are not certain
yah im agreeing w/ you @keen compass
a buffer overflow in the sqlite lib wouldve been discovered long ago
whilst possible its sqlite, realistically its not
Also have to remember, the docker container isn't crashing either
if the kernel was segfaulting there would be more problems then just the JVM crashing in a docker container and more of their customers should be complaining. Wouldn't make sense that only a specific person complaining which makes me think it is more HW related then anything else. As well as empty registers which is not normal.
Hello does any know how I can find a canter of a schematic in world edit api and teleport a player there thanks
canter?
centre
@silver pewter math
my bad haha
or you mean the location that person who created schematic stands on, whatever that called
offset
It needs to be the location of it as It's generating a random location in the world to paste it then spawn the player and il try offset thanks
offset is the location from where a person stood when they created the schematic
if you need the center of the schematic, you can get that by getting the relative locations of the schematic which is the opposing corners
from there you have to do math to get the center
okay thanks
@obtuse rose I am not saying the kernel can't be responsible, just that there is no indication that the hosting provider is receiving multiple complaints about the problem. If it was a memory module, not everyone would be affected, just only the applications that attempted to use that specific module. But if it is the kernel, it would still be interesting to know why the kernel is freaking out over docker or the JVM.
Also if the hosting provider is using common kernels that everyone uses, just like the memory module, its very rare to happen
especially with applications like docker or the JVM
@keen compass why are we going back at this, I did said I agreed that it's probably hardware π€
Caused by: java.lang.ClassCastException:org.bukkit.craftbukkit.v1_15_R1.CraftWorld cannot be cast to com.sk89q.worldedit.world.World
I didn't see that sorry @obtuse rose
π€·ββοΈ
thanks
Or, rather, BukkitAdapter.adapt(World) works as well. Depends on what you need I suppose
I am not quite understanding one thing from the Spigot Javadoc
the PlayerCommandSendEvent is returning a list of commands, and not a single one?
Correct
PlayerCommandSendEvent is called when the server sends the list of known commands to the client
yeah probably
is therea PostProcess or something
called after the command has been executed,
ok thank you. PlayerCommandPreprocessEvent is fine anyway
Just read those docs to make sure you're not doing something you shouldn't be
Method org/sqlite/RS.isClosed()Z is abstract
Anyone?
Does anyone know if the OfflinePlayer passed String onRequest(OfflinePlayer, String) in PlaceholderAPI can be instanceof Player
Can I cast or will I have to grab the player myself
Hello, does anyone know how to use tab complete with bungeecord ? I have an issue with command /ban and /msg and all other minecraft-natives commands, I'm looking to made a custom tab with them, but for now don't fin a trick :c Can someone help me ? π
if (offlinePlayer.isOnline()) {
Player player = offlinePlayer.getPlayer();
}```
No casting necessary
(pretty sure it casts internally, but shush)
is the WorldLoadEvent not triggered on startup?
or is it triggered before Postworld plugins are loaded?
Well, post world means your plugin is enabled after worlds loaded
So that event has long passed
You would iterate all worlds it you use post world
What Nexus?
Well you also use worldedit 6...
That screenshot clearly shows you downloading WE 6
would cha look at that lul
how would one do that
@hoary parcel you actually don't know what Nexus is or that's a joke?
seems like he was talking about a specific Nexus... not in general mate lol
ohhhh okay
I run my own Nexus at repo.minidigger.me, lmao
It's known as the MiniNexus?
yea, I have a feeling I've heard you mention that
I dused to have nexus but now I uploaded it manually and serves it via Nginx
because less RAM usage π
i dont even know what hc.to is
all i know is that times out and that my builds take forever now
And that's why you out a comment to repos you add
Or, don't add any custom repo at all
I just mirror everything instead
So my builds are actually stable
My projects only have repo.minidigger.me as repo
non of them even point to that nexus tho, but idk much about how maven resolves shit so idk
@hoary parcel how much RAM your nexus take?
Idk, zero?
π€
what did u change exactly @rough root ?
mine took like a GB
is giving this error when a friend of mine enters the serverhttps://cdn.discordapp.com/attachments/711216169050308658/714856327083458611/unknown.png
I run so much shit in that server, It doesn't matter
how much RAM you have in total xD
@deep olive is your server port forwarded?
I think 16 on that particular one
Also now i have a different issue. I'm now listening to the world load event (changed my plugin to load at startup). However, now i have issues with load order, since my config defines what plugins to depend on, so i dont have a proper way to deal with loadorder π€
yes
@minor laurel I've changed a lot. I don't know. Been dicking with this for quite a while. I'm using this on a creative server, with the top level of the world at block level 4.
I put it on Port Triggering or Virtual Server
Hmm. I can't find much on it.
players are able to place chests - but they're not creating claims, can't be removed and giving me the message I stated before.
my router and a TP-link
Potentially check sea-level in GriefPrevention config @rough root
set to 2
try -1
ah so it's been resetting as you've made changes?
yeah.
I'd try full restarts then and see if it makes any changes.
rather than using a plugin's reload command.
Unsure then. Contact the developer possibly.
Robo quit
Is there a reason why Maven is not importing a Bukkit artifact? I have referenced repo and dependency in POM, but it still acts as I never imported the artifact
Here is how the POM setup looks like: ```xml
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.github.eirikh1996</groupId>
<artifactId>NationCraftGUI-Core</artifactId>
<version>Core</version>
</dependency>
</dependencies>
But the Bukkit artifact will not import
Someone know why TabCompleteEvent wont fired in bungeecord with command /ban and all other natives commands ?
Is it possible to speed up / slow down hoppers individually
I'm not seeing it in the javadocs but it sounds like something that should exist
Do I just have to listen to inventory move event and do it?
@obtuse rose @keen compass update: they've said it's "version related"?? :/ https://lucent.host/16svv4.png
how do i give permissions? there is a hasPermissions() function but not a givePermission
Also, can I get some help regarding the issues I have importing Bukkit into my project?
error?
@limber sierra this jar isn't the one you've used earlier?
I mean like back when you said it was working
ty
Alright, When can someone tell me why the Maven artifact is NOT importing the Bukkit library into my project, despite the very fact that I have referenced BOTH the correct repo and dependency in the project's POM. It is also a multi-module project, IDE is IntelliJ IDEA, language is Kotlin, and I am using the recent versions of both
does it work in the CLI?
What is CLI? @hoary parcel
mvn install
not using clean π€’
Also, when I try to use for example JavaPlugin to extend the main class from, the IDE generates a cannot resolve error and when I Alt + Enter it to get a fix menu, none of the fixes are import
And yes, I tried with re-import, mvn clean install but no luck
send stack trace? send pom.xml?
Issue is the same
there isnt just a magical solution .-.
@brittle stone remember that now in intellij idea you must click the maven icon (top right) to reload the pom file
Here is the full POM: https://gist.github.com/eirikh1996/933b4db46386577defae28e4dcf7d31d
@languid pewter Is that new in IDEA 2020.1?
not using clean π€’
@dusty topaz why would I use clean and slow down my builds?
Click that icon
because sanitisation
@brittle stone
is key
doesnt make much sense
idk, i always clean install if installing
Problem is @languid pewter that I cannot find that icon in the location you are specifying
what OS are you using?
Windows or macos/linux?
Changing the theme, I have a little question, does the permissions in bungee.yml works like in plugin.yml?
I'm starting with bungeecord API and I want to know that
@limber sierra this jar isn't the one you've used earlier?
@obtuse rose i edited that message to say nvm lol, the only jars i've tried are spigot 1.12.2 and paper 1.12.2
How do I make a player open some sign? Asked here before but I donβt think anyone saw.
@limber sierra figured out your issue
your issue is the sqlite lib shaded in server jar. You need an sqlite version compiled under musl and not gclib
there should be one in the repos for alpine
Smh
I'm using Java's Time functions and when I try setting the time to expire more than a few weeks it seems to limit the time to only a week and a half, does anyone know how to fix this? Here's a small example of how I'm using it:
int second = 1000;
int minute = second*60;
int hour = minute*60;
int day = hour*24;
int month = day*30;
int year = month*12;
Date date = new Date();
long numberToExpiredDate = date.getTime() + (month * 2);
Date dateToExpire = new Date(numberToExpiredDate);
toBan.kickPlayer(reason);
Bukkit.getBanList(BanList.Type.NAME).addBan(toBan.getName(), reason, dateToExpire, player.getName());
Banning for a day works fine ^
that looks really really dum logic, why dont you use the new time api?
LocalDateTime.now().plusDays(1).plusSeconds(100).plusMonths(111)
^^^
Ok thanks
Says it needs a date, not LocalDateTime
Tried casting and it doesn't seem to work
need to convert back to date
Oh ok, how would I do that?
Date.from(ldt.toInstant()) iirc
Ok thanks
What is the easiest way to listen all of blocks in a world? I've tried "BlockPhysicsEvent" but this is not what exactly I want. So is there any other way?
what?
You can't "listen to a block". You can listen to something that happens to a block, sure
There are several Block Events
You can check if they're broken, placed, formed, and some more information
Right. You're not going to listen for every single thing that happens to it in just a single listener. That's not how that works
^
Okay, we can say I'd want to check liquids. I've tried all of the events related blocks and found that they doesn't work whenever you place block at liquid source except BlockPhysicsEvent
Using something like BlockFormEvent or BlockToEvent should work, let me check quickly
BlockFromToEvent May work
When you click a slot in my gui it jumps 2 inventories over (for example when you click an item in slot 13 which opens an inventory then it clicks slot 13 in that inventory too). Anyone know how I can fix this?
Did you try to place a block at liquid source?
The event doesn't work whenever liquids back off
Hey is their anyway to make a minecraft server that pc and the consoles can play on
Potion You can use Nukkit to let consoles play on servers, may want to join their discord for more information
It's a bedrock API ^
Not Java
@pastel condor You should have show your current code to us so we may help you.
final Player player = (Player) event.getWhoClicked();
if (!(plugin.getGUIInventories().get(player.getName()).equals("AdvancedSettings"))) return;
event.setCancelled(true);
}``` and ``` public void openInventory(final Player player) {
final Inventory inv = advancedSettingsGUI(player);
player.openInventory(inv);
plugin.getGUIInventories().put(player.getName(), "AdvancedSettings");
}```
Also sorry Black I missed you though did you try BlockFromToEvent Yet?
theres more too I can show you the entire class if you need me to
Ok Fier though can you upload the code to Hastebin or Pastebin?
As I see from javadoc, you're right but doesn't work whenever liquid source destroyed
That's weird
yep
Only physics event works but it's for physic and calling 4 times for block faces
No error. It works
Okay let me take a picture
If you place water, it works but if you destroy the source, it only works for source, not spreaded waters
I'd like to know spreaded water status.
Okay, let's change the question. Is there a way to find source of water from its spreaded part.
not really
you can loop
and detect by level
actually nevermind
that wouldn't work if it's a cascade
there is no easy way to do it π€
unless you control who places water in first place
it might be easier that way
@wheat summit Thanks
@wheat summit I forgot the test only one event which works...
You were right. "BlockFromToEvent" works but I've to put some delay on it lol
here is my gui code btw https://pastebin.com/fK9NP5Xp
when you click an item it jumps 2 inventories, for example when you click settings it jumps to the settings gui then to the basic settings
same with when you click advanced settings, it click it then toggles a setting
you should try with put "return" each if statement
I did
my code is here, I have done all that https://pastebin.com/fK9NP5Xp
What's the SettingsGUI Function?
Also personally what I did is checked the name of each item clicked
but still what if I have 2 grass blocks?
I would prefer not to just try random things, as it was working perfectley when I checked the entire array of contents of the inventory. So I know that shouldn't be the problem the problem must be with line 28 or 103
and use else and if or return. It's not best to use like that.
if you use like that, the code will scan all of the statment even first one is true
yes, but how would that solve the double clicking?
Hey guys how would I make a core plugin so I can have modules?
maven
Hi, I'm a little new to this but I hope you understand me.
I train a network which is hosted on a dedicated server but I don't know how to make it work / restart
21:05:01 [INFO] [Rickylacio] <-> ServerConnector [lobby] has connected
21:05:03 [INFO] [Rickylacio] <-> ServerConnector [pryma] has connected
21:05:03 [INFO] [Rickylacio] <-> DownstreamBridge <-> [lobby] has disconnected
How i can fix this?
i want have a force connect all time in Lobby server
Thank you
@languid pewter The OS I am using is Windows 10
This is coded with the ProtocolLib API and I dont know why the Packet Listener doesnt calling when i click done on the Sign here the Code(Method): https://hasteb.in/funasefo.java my MC Version is 1.14.4 ...sorry for my bad english
don't work
21:20:51 [INFO] [Rickylacio] <-> ServerConnector [lobby] has connected
21:20:53 [INFO] [Rickylacio] <-> ServerConnector [pryma] has connected
21:20:53 [INFO] [Rickylacio] <-> DownstreamBridge <-> [lobby] has disconnected
watch
i need to add restricted: true to olther servers?
@brittle stone So you should use CTRL+SHIFT+O I guess
let me check
Yes, it's that
try using that
You can also check this image: https://i.imgur.com/NhIoK0a.png
I tried. The effort, however, was totally in vain
Issue remains the same
I even tried deleting and re-downloading the bukkit artifact folder in the .m2. Didn't help either
I am really out of options
The artifact reference appear in the Maven window: https://gyazo.com/91c370399a0bd070d04477d742a93bb0
But it does not appear under "External libraries": https://gyazo.com/70e90fce29562ce7856428fcc4fbc054
Try creating a ticket in jetbrains youtrack
maybe it's a intellij issue
also try updating to latest version
and disabling plugins, maybe one plugin is causing the issues
Guys, I'm using 1_8_R3 base for my plugin and it's cross version over 1.8+. Because of things like the left hand, would it be possible to interact with it or not?
the left hand ability doesn't exist on 1.8?
welcome to the ancient versions
where nothing exists and you will have to make work arounds for it :p
:')
Anyone have any solution?
22:16:52 [INFO] [Rickylacio] <-> ServerConnector [lobby] has connected
22:16:54 [INFO] [Rickylacio] <-> ServerConnector [pryma] has connected
22:16:54 [INFO] [Rickylacio] <-> DownstreamBridge <-> [lobby] has disconnected
i want have a force connect to Lobby
always
Also @languid pewter I am doing it on Kotlin
@opaque swan
force_default_Server: true
Having forced hosts will bypass that, so make sure people can only connect to the network under one domain
@brittle stone yeah, but that doesnt matter, I also create kotlin plugins, it might be something else, try creating another project
or maybe reinstalling intellij
I reinstalled intellij and it still happens
I also submitted an issue report to JetBrains
Error: Method org/sqlite/RS.isClosed()Z is abstract
SQLMain.java (OnPlayerJoin Event): https://hasteb.in/udofezaj.java
SQLBase.java (Select methods): https://hasteb.in/vejiwire.java
Idk why it is not working. I need it for now
you cant invoke an abstract class nor use the method coming from the class. You'd need to invoke the overridden method then
on documentation it is not abstract
So what should I do? Override isClosed Method?
send class of RS ?
can someone do a config review, to see if this is easy to work with (plugin i'm developing atm) https://paste.md-5.net/cozilimaro.shell
BuildTools will compile the API for you
Accessible through Maven with the spigot-api artifact
If you want the artifact, should be in Spigot/Spigot-API/target (relative to the BT directory)
bugging me. anyone know the issue.
expected <block end>, but found BlockMappingStart
0:
type: '[firstjoin]'
actions:
0_sub:
subtype: '[broadcast]'
text: 'EnumBot Welcome to the server'
1_sub:
subtype: '[msg]'
text: 'EnumBotPrivate> welcome to the server'```
https://timings.aikar.co/?id=55d80160ffa14f1dafc57f308349c31a Can someone please tell me what's causing my server to constantly be at 10tps? So confusing
ok
Ceezy,
subtype: '[broadcast]'
text: 'EnumBot Welcome to the server'```
Can't do this
You're trying to make it a string and a section
mineresetlite mason
can someone help me how can i enable mcmmo? https://pastebin.pl/view/c014c5dc
thanks choco, fixed
Hi, I have a problem with my spigot account, I can't get in because I don't have the 2 factor code
@naive goblet RS is build-in class named ResultSet
@frigid ember probably an error on boot. We would need more in order to help you.
And i dont have Access to it
@errant valley You need to use either the 2fa generator for a key, or use the backup codes they give you (which the remind you to write down every single time you log in).
If you don't have either, you're SoL, as they do not do account resets anymore according to their reminder.
@worn temple what you need?
@worn temple I have no key app, how do I do it?
@frigid ember namely for you to check if there are errors when the server boots. If there aren't, remove any "hotload" plugins like Plugman, as they are only meant for developers. If you are still having issues, contact the dev of mcmmo since it may be a code issue.
ok il check
@errant valley You can't have enabled 2fa without an app like authenticator. Again, you either need the otp generated by authy/authenicator when you turned on 2fa, or your backup codes. Otherwise you can't login and should make a new account.
if i start my server it says [ERROR] [mcMMO] There was an error while enabling mcMMO!
Okay, what's the full error? pastebin that please
i already looked and i have the latest version https://pastebin.pl/view/b07eba09
whatever mcmmo version you are using, it doesn't seem compatible with spigot 1.15.2. mcMMO is a premium plugin btw
@worn temple I had bought plugins in that account, can't I do anything?
ok il check with the dev of mcmmo
@errant valley No, if you didn't bother writing down the backup codes like you were told many many times to do, you getting locked out of your account is on you.
yes but what does it mean, one can also lose backup codes. I have taken a new pc it is normal that I have nothing left
Its on you to make sure you always have those backup codes. This is why you should be using a password manager like lastpass where you could store those backup codes.
okay, are you sure what you say? because you are only a verified user
what do you mean you lost your codes not us
also quick question how do i get rid of the commands showing up red in bungee even tho they are correct
@errant valley Its what the website says. https://owo.oooooooooooooo.ooo/i/alpe.png
I need a bit help with making fake player to which players can send /tpa or /msg
is it possible to create player on server not just thru packets
so player is killable
thanks
You can make an NPC, but you can't truly make "fake players"
So, to your question, no, that's not actually possible. You can make them through packets in the tab list, and an npc that can be killed, but you can't make it possible to /tpa, etc. unless a plugin is specifically made to handle those commands and make "fake players"
oh ok thanks
I mean... you can make a fake command sender, but plugins are going to absolutely hate you for it
^
True
Forgot about that, but yeah, most plugins will really hate that
You'd break way more things than you'd think
also quick question how do i get rid of the commands showing up red in bungee even tho they are correct
@ebon yoke anyone ?
@subtle blade What I mean is really player should be able to send /tpa or /msg to fakeplayer
so real player thinks that person is online
and they don't get message "that player is not online "
xd
how do you check the location of a chest when itβs closed?
can you use event.getInventory().getLocation()?
Hello, is there any good way to calculate blocks between player and this.Example point?
Pretty sure there's a distance function somewhere, or you make a vector for each and then do the distance calculation on that
@subtle blade What would the InventoryHolder do? Iβm checking for a chest at a location.
well if you have an inventory...
you can get its holder, and InventoryHolder has a getLocation() method
Iβm assuming event.getInventory().getLocation() would work in the same way?
Do Inventories have a getLocation()?
Huh. TIL they do
So what's your question then. I don't understand
I didnβt know if event.getInventory().getLocation() would get the location of the chest or not
It would
Great
I have a legal stuff question, if I made a plugin and I uploaded in spigot, can other website take my plugin and use it in their own website?(Im talkin about those minecraft web hosting), they are offering plugins to install, and in that list its my plugin.
Idk if I can do something about it or they have the right to do it
That's up to you. You're the one licensing the project and the one who should take legal action if they're in violation
If you mean the web panels that are "one click install plugin", depends on whether or not they download it from Spigot or they host mirrors
If you're talking about a free plugin, honestly who cares? So long as you've gotten your credit, you're not really losing anything
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getClickedInventory() != null
&& event.getClickedInventory().getType() == InventoryType.PLAYER) {
Player player = (Player) event.getWhoClicked();
if (event.getRawSlot() == HELMET_SLOT) {
ItemStack cursor = event.getCursor();
if (HelmetItem.getInstance().isHelmet(cursor)) {
player.setItemOnCursor((event.getCurrentItem() == null
|| event.getCurrentItem().getType() == Material.AIR) ? null
: event.getCurrentItem());
player.getInventory().setHelmet(cursor);
}
}
}
}
why does this not work, but running the setItemOnCursor / setHelmet stuff works if I runTask
Bukkit.getScheduler().runTask(oxygen, () -> {
player.setItemOnCursor((event.getCurrentItem() == null
|| event.getCurrentItem().getType() == Material.AIR) ? null
: event.getCurrentItem());
player.getInventory().setHelmet(cursor);
});
this works for some reason though
is there anyway to make my resource private? just accesible with a link? X))
No
Hey, does someone knows how to get server compression threshold from a spigot plugin?
How can I install slimeworldloader without changing run.bat because my host doesn't allow for that
Thats not really necessary
still i would recommend getting a private host
that flags are to increase ram in your server, you dont really need that and your host manages that.
How can I install slimeworldloader without changing that?
did you atleast like, understand what flags do?
Yeah it's at 1:20
Oh i didnt see that
no way sorry mate
You have to get a dedicated hosting or vps for that
I can't delete my own reousrce 
@bright forge @frigid ember You can't change the memory flag unless you purchase more with the host you are using. That's what that flag is, its max ram allocation... so you'd have to pay more to get more
wellll
hey..... How can i create config section?
@frigid ember Create aconfig.ymlfile, and request info by using instance.getConfig()
you can use a jar that launches another jar
your host won't like it
but it'll work
@frigid ember
I'll only work if they don't containerize everyone's instances (which they should be doing now). And, if your host notices, they will just shutdown your account without so much as a warning, so rip all your configs and world data.
why would docker mean that a jar can't launch another jar
No, it can launch another jar, that's not the issue. The issue is changing the run time flags and allocating more memory
not enough ram allocated to the container
I saw the mem flag highlighted, that's why I was saying that
But depending on the flags, the host could just delete their account anyway.
yeah he was just demonstrating he can't edit it
Didn't mean to highlight that, but I'm trying to add -javaagent
You'd have to check the ToS about doing something like that
if you contact your host they should be able to add additional flags for you
alright
anyways, do anyone knows how to get network compression threshold from a plugin? Im trying to add a custom decompressor.
Not sure what you mean by that
Also, not sure why you want to add an agent... since that can cause a lot of performance issues.
server.properties -> network_compression_threshold
I need to know how to get that value
Its an api to manipulate packets
like its not 100% important but i want developers to be able to decompress and compress with a method
my server has a 1MB/S upload speed, what should I set the compression threshold to?
oh (haven't worked with spigot since early 1.14 so I'm a bit rusty).
Load it as a Properties file. and then get the network_compression_threshold key
@pastel condor you should be fine to just leave it as it is until you get a ton of players. 1mb/s is plenty for a small server
1mbps will do you 2 players
It'll do more, I hosted a 30player server on 3mb/s up
I generally see 0.5mbps/player
I was able to get 10 - 15 on and it was pretty good
according to netdata
I see
I don't think those numbers are realistic. I'd like to see if they factored in other possible bottle necks.
Low upload speeds are fine for smaller servers. You should be okay to just leave the compression alone
Anyone can help me with a custom craft? I dont really know why it isnt working, here it is the craft. https://pastebin.com/a0Q2AWXM
@bright forge pseudo code here since I don't know it off the top of my head
File settingsFile = new File("./settings.properties");
String netComp = "";
try {
InputStream fil = new FileInputStream(settingsFile);
Properties settings = new Properties;
settings.load(fil);
netComp = settings.get("network_compression_threshold"); //Should be a string returned.
} catch (IOException e) {
//handle file read error
}
Likely plenty of errors in that, did it all without an IDE. But that should be the gist of it and enough to get you to what you need.
thank you man
Np
I think getProperties should be added to Server object
so people doesn't have to do this process all over again
There may be somewhere it's at, but I don't know, so this is the best solution I could think of lol
I hope haha, thx for that, this will be my solution atm
yee
how do you differentiate a click from the top or bottom inventories from an if statement
Using InventoryClickEvent
Help
I tried to use BuildTools to install Maven with the NMS on it
But it didn't add anything to my current version
I think it's because BuildTools installed maven by itself
I have the spigot jar, what can I do to add the full spigot to my local repo????????
I already have maven on my system
BTW, MacOS
@left plover I think its all indexed, so you should be able to tell based on its index. But I don't know where that index starts at relative to the top and bottom
@plucky relic You can add spigot by including the dep in your plugin's pom.xml, and craftbukkit has to either be manually imported in, or hosted in a maven repo and then referenced in the pom.xml of your plugin.
It isn't different weirdly, I tested it and it indexes the top and bottom like completely different UIs
You can specify the version. spigot is hosted on a maven repo so you can just include it in your project like other maven deps. CB has to be imported manually, differing depending on your IDE unless you have a private repo set up, but that's a whole thing on its own
CB can be built from BuildTooks, correct?
Yes, but then you have to import it into your project manually
@left plover I can't say to the validity of this, but here's a thread about the same question: https://www.spigotmc.org/threads/determining-whether-a-player-clicked-an-open-inventory-or-their-own.112328/
oh does that mean .getRawSlot() is the actual slot hm
Also.. there is local repos, right?
Its not too hard, but you'll need to know a bunch of networking, maven, apache, and other server stuff. You can just add the jar manually to your project outside of maven.
IntelliJ: https://stackoverflow.com/a/1051705/9570150
Eclipse: https://stackoverflow.com/a/3280384/9570150
There is local repos, but you have to mess with maven's settings.xml which can be hard to find, and is a pain to get pointing to the correct spot.
Ughhhh
@left plover I don't know, but they did mention checking if the inventory clicked is implementing player inventory or not, if it is, its the bottom, if it isn't, its the top.
Again, I can't speak to if its completely correct, I'd have to test that myself and can't do that right now
Nova
I excecuted build tools.
I got some maven repos
Including one titled CraftBukkit
If I package it, will it be the CraftBukkit jar?
Yes, I know what BT does. You should just have the craftbukkit jar already.
It only gave me the spigot one
It should be giving you CB as well, always has for me. That's how I got all of them hosted in my private repo online
k
Hey guys, is this correct?
for (UUID uuid : members) {
Player target = Bukkit.getPlayer(uuid);
if (target.isOnline()) {
}
}
or do I have to do
If (target == null)
first?
Yess
it works
tysm
I'ma make a private repo later on cause this is shit but thx
@frigid ember I'm pretty sure getPlayer() is nullable.
It is, pretty sure it will return Null if the player is offline, however OfflinePlayer will always return something
if the player is null, then the player is offline. So, there's no need for the target.isOnline() check
When using OfflinePlayer, you're right you'll always get an OfflinePlayer, but it might not be a real player.
You have to check OfflinePlayer.hasPlayedBefore() to make sure it's an actual player and has played on the server
@radiant pollen so if the player has logged off then this will be fine and not through errors?
for (UUID uuid : members) {
Player target = Bukkit.getPlayer(uuid);
if (target != null) {
}
}
Yup, that will work
hey so im new to like spigot and bungeecord and all that, well i have 3 servers and i was wondering how i could like the hypixel npc's to take me to another server
Anyone know how to pull an enum constant given just a String
@frigid ember YourEnum#ofValue("yourString");
@hazy nimbus how to code them? or how to add them, usually it was the Citizens plugin with addons that allowed actions like that.
well for now just how to ad them, ill check it out thanks
@worn temple Do you mean the valueOf() method?
enums have a valueOf method
I know
I need to explain this better
First of all, if you care enough, I asked this question on Stack: https://stackoverflow.com/questions/62035033/retrieving-enum-values-from-unknown-string?noredirect=1#comment109718775_62035033
If you'd rather I explain it here, I'll give it another go:
Basically, I am given a String
"gaul"
"rome"
"greece"
etc
I have an enum like so:
GAUL_RAM_UPGRADED("gaul_ram_upgraded.schem", new Location(Bukkit.getWorld(Statics.worldName), 0, 100, 0)),
GREEK_RAM("greek_ram.schem", new Location(Bukkit.getWorld(Statics.worldName), 0, 100, 0)),
GREEK_RAM_UPGRADED("greek_ram_upgraded.schem", new Location(Bukkit.getWorld(Statics.worldName), 0, 100, 0)),
PERSIA_RAM("persia_ram.schem", new Location(Bukkit.getWorld(Statics.worldName), 0, 100, 0)),
PERSIA_RAM_UPGRADED("persia_ram_upgraded.schem", new Location(Bukkit.getWorld(Statics.worldName), 0, 100, 0)),
CARTHAGE_RAM("carthage_ram.schem", new Location(Bukkit.getWorld(Statics.worldName), 0, 100, 0)),
CARTHAGE_RAM_UPGRADED("carthage_ram_upgraded.schem", new Location(Bukkit.getWorld(Statics.worldName), 0, 100, 0));```
Hey
The String can be the first part of that constant
but I don't know matter of factly which it will be
I'm looking for an easy way to pull that constant & its related values based soley off a semi-unrelated String
Loop through them and find a match
They won't watch
match*
Only certain portions of the String will
You could use some dynamic programming to solve this probably
But a waste of time
Even if you do that though, it does not return the constant
It gives back a String
So then I will have to have these gross "if" statements everywhere
MyEnum found = null;
for (MyEnum e : MyEnum.values()) {
if (e.name.contains("myString".toUpperCase()) {
found = e;
}
if (found != null) {
//Do something
}
}
Okay
Suppose I made a custom entity by extending from entity zombie
If I do a listener to check, say for exmple, a hit, and I get that entity
If I do an instanceof, will it give me the custom class I made?
https://owo.oooooooooooooo.ooo/i/xp2e.png
Basically, check if its the base entity you used, then cast to that, then check if its your entity, then you can cast to that.
You may be able to not do the cast twice and go straight from entity to yours, but I'm not 100% sure. The code in this snippet is about 4 years old now... but it did work at the time.
Okay
And suppose
Okay
How could I give a NMS Entity, a way to store some data on it
Like an "id"
of sorts...
You know what, nvm
It shouldn't be necessary.
You can do that in your class
I mean yeah
I was thinking of the constructor
But the zombie wouldn't hold said variables.... or would it????
Yeah, just override the constructor
https://owo.oooooooooooooo.ooo/i/vqe0.png
Wait
so if I get the entity
s
cast it to my custom class
and get the valu
it will hold said value??
That's epic
yeah, that's how inheritance works
Siiiiickk π
I thought it would just think of it as a normal zombie
Wait
Okay, hear me out on this
Can I make a class that extends Entity in general, and holds an ID
And other different entity classes that extend said class, so that all of them will also store ID's ?
I think I'm missing a step on what I said, most likely, but basically, I want to make different "EntityMobs" but have all of them have an identifier
Just have:
MyEntityData extends Entity
MyZombie extends MyEntityData, Zombie
and then if you cast, you either cast to MyZombie and get the entity data and other zombie stuff, or cast to MyEntityData and just grab the data.
That should work, assuming you do that for each of the mobs you custom make
implements then
you can IMPLEMENT more than 1
you sure????
Well, it should.
Basically forces each custom entity class you make to extend from the entity its related to, and then implements the methods defined in the MyEntityData class, which can have defaults laid out to reduce repeating yourself
im really tired, and doing 10 things at once, so I may be a bit off, but this should be this general principles of it
it's ok
Does anyone know if there is a way to change how the command structure that is formatted for 1.15 for the command structure for previous versions? Like getting rid of the tab suggestions and saying "that isn't a valid command" even when the client doesn't know what it's talking about? Or is it purely client side?
Because you can't just extend entity since its such a low level base class, so you'd either have massive chain of extensions (really bad), or just use an interface and define required methods so your code can just cast to the interface and call the ID method you want.
@frigid ember its not purely client side. There's a tab completion event you can override and help it along, but its plugin specific, so each plugin would have to do it.
At least, the last time I messed with that stuff, it may have changed.
@frigid ember If you use the plugin.yml to specify permissions for commands, a player won't be able to see tab completions for commands they don't have permissions to use.
@frigid ember its not purely client side. There's a tab completion event you can override and help it along, but its plugin specific, so each plugin would have to do it.
At least, the last time I messed with that stuff, it may have changed.
@worn temple Alright. This new command structure thing whatever is quite annoying. Sometimes my slash gets doubled and then it screws with me typing in commands and whatnot. Could just be me, still hate it.
lol that's just you
Rip my keyboard is messed up
Saw your message, dw. The bot is stupid.
Β―_(γ)_/Β―
it is hard to use disguise api? i want to change a zombie skin when hitted by another player
anybody know why this is showing up in my timings report?
0.06% 88.54% 0.04 s 44.27 ms 0.0 0.0k World Save
anybody know whats going on?
https://hastebin.com/acikuheyaz.rb
@wanton vine Check if you have a firewall that blocks the UTC port on your Network/Computer, but It could also be if you bind to a false port, ic you changed that
because I had this Problem with my firewall and it seems preatty the same Issue here
UTC port is not a thing
Does anyone know how I can take the yaw from a Location and set a block (chest) to be facing in the proper direction?
How can I change ghast fireball damage (ExplosionPower)?? 
nvm I realized
Hey guys, is this the right place to ask this? For youtube I search this and nothing pops up, but if I search just Notely then my channel pops up. I put both tags on my channel and videos but only notely works
"Spigot"
anyone know how to change the multicraft panel to ssl? I already have it installed and dont want to lose my current files.
@marsh hawk is it your own server machine? you have SSH access?
yeah
i read some source and it just says use a reverse proxy but that doesnt seem to work
Hello, what's the best way to crate an region when someone creates an area thanks π
@silver pewter what do you mean?
Bukkin runnables only can take 25L of delay?
when I put something higher than that the block dsnt work
no there is no limit
This works:
scheduler.scheduleSyncDelayedTask(instance, new Runnable() {
@Override
public void run() {
player.kickPlayer(ChatColor.RED + "Has sido PERMABANEADO");
Bukkit.getBanList(BanList.Type.NAME).addBan(player.getName(), ChatColor.RED + "Has sido PERMABANEADO",null, "console");
}
}, 20L);
This doesn't:
scheduler.scheduleSyncDelayedTask(instance, new Runnable() {
@Override
public void run() {
player.kickPlayer(ChatColor.RED + "Has sido PERMABANEADO");
Bukkit.getBanList(BanList.Type.NAME).addBan(player.getName(), ChatColor.RED + "Has sido PERMABANEADO",null, "console");
}
}, 125L);
Long.MAX_VALUE + 1 is your limit
hm?
wait that would be 1 frank i think
because it referts
that or negative max long
π€
Negative
you are missing an argument
there should be two
well technically 3
mmm, I see I am tired

it should work, if it is your IDE complaining then you need to fix your IDE
use lambda plz
Bukkit.getScheduler().runTaskLater(plugin, () -> {}, delay);
@silver pewter what do you mean?
@keen compass would worldguard be the best option so players can own their own land?
well it comes with an API to leverage regions for custom stuff
so if you are meaning like making a plugin would it be wise to use worldguard, probably as it makes doing quite a few things easier if you are not familiar with them
Okay thanks
What fixed it
probably restarting the IDE XD
Oof
guys can i get help in something
when a server is offline in bungeecord it gives a very big message
is it possible to change it
?
the one 'could not connect to a fallback...'
yes
I don't think so , I might be wrong.
i need to change it fast π¦
you could use a plugin to remove it from the list until it comes back online
Can I distinguish between slime generate naturally and slime that generates by the kill of the first slime?
God bless you
so the first one you can use your normal entity spawn event
second one, slimesplitevent
Want to hear what am I doing? maybe you can give me any tip
if you want. I am not an expert π
Me neither
Im makin the slime spawn with a higher size
but when I kill it the splits are the same size
larger size slimes? like super giant slimes?
with the slimesplitevent you can get the amount and sizes with the event
and then you can just simply cancel it and spawn new ones with whatever size you want
if it meets a certain criteria to do so
instead of cancelling a better way might to use the setCount() method and set it to 0
and then just spawn new ones afterwards
this way you don't have unnecessary entity objects being created and then tossed away lol
So I can but the event in there and just change their sizes every time it kills a split?
yep
since it gives you the entity in the event which will be a slime
and slime has setSize()
so you have multiple ways to handle it π
actually that would be an even better way because then you don't actually have to do any spawning yourself, just set their sizes when they split π
Can anyone help me with this?... This is coded with the ProtocolLib API and I dont know why the Packet Listener doesnt calling when i click done on the Sign here the Code(Method): https://hasteb.in/funasefo.java my MC Version is 1.14.4 ...sorry for my bad english
if I set: cancell the slime will die without splits am I right?
ill make him split 1 time and then just disappear
@reef sparrow if the server never receives Open Sign Editor before it gets that packet, that packet will get silently ignored
But the open sign editor packet is called and i recieved the text message but the update sign packet dont send the broadcast message
@keen compass do you know why this doesnt work?
does it throw any errors?
just fyi, your String needs to be an array since there is 4 lines for a sign
also, there is a block location in that packet as well
Know only it says I tried to edit a non-editable sign but in the PlayerInteract Event I set the opened sign to editable true...
you can't edit signs after you close the edit sign window
another packet doesn't get sent for it
also, there is a block location in that packet as well
@keen compass Yeah but i dont know how to get the Position
you can't edit signs after you close the edit sign window
@keen compass But the sign is opened the only problem is that when i click done nothing happened
here is the complete Listener Section of my code https://hasteb.in/bipilefe.java
and here is how i open the sign https://hasteb.in/xuvijufe.java
you could use a plugin to remove it from the list until it comes back online
@keen compass im sure that changing the message will be 100% better tho
@keen compass Please help me because i dont know how to solve my problem...
Why is this not cancelling the slime to split in other slimes?
@EventHandler
public void onSlimeSplit(SlimeSplitEvent event){
event.setCancelled(true);
}

public void onSignUpdate(PacketEvent packetEvent) {
PacketType t = packetEvent.getPacketType();
PacketContainer p = packetEvent.getPacket();
//gets the lines in the packet
List<String> lines = p.getStrings().getValues();
//gives you the location of the sign
Location signLocation = p.getBlockPositionModifier().getValues().get(0).toLocation(World);
}
ohh thanks but my main problem is that the Sign Update Packet Event doenst be called
@barren abyss try doing event.setCount(0); instead
you need to implement PacketListener for it to get registered properly @reef sparrow
oh nvm I see my error
Okay i try this thanks
the event was after the normal spawn event
ah
Well if you are going to cancel the event, don't do that
uses up more resources
just use setCount(0); instead. The difference is this tells the server to not generate entity objects
as opposed when you use event.setCancelled it already did
but then just tosses the objects away
Okay! thanks for the tip appreciate it
Block block = e.getBlock();
if(block.getType() == Material.STONE){
}
fixed it @frigid ember
ok, think I am safe to reboot now that I have helped everyone π
if you still having problems I will be back shortly π
@keen compass when i implement PacketListener it adds this methods ```@Override
public Plugin getPlugin() {
// TODO Auto-generated method stub
return null;
}
@Override
public ListeningWhitelist getReceivingWhitelist() {
// TODO Auto-generated method stub
return null;
}
@Override
public ListeningWhitelist getSendingWhitelist() {
// TODO Auto-generated method stub
return null;
}
@Override
public void onPacketReceiving(PacketEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void onPacketSending(PacketEvent arg0) {
// TODO Auto-generated method stub
}```
what is to do with this methods
You need to implement those to have a proper listener for the packets
not all of them need to be implemented just some of them
the ones which u dont need just {}
ListeningWhitelist just sets the type of packets your listener listens for
How does I use these until now I do my PacketListener in the Main Class
wut
you have to implement that interface if you want a listener for packets in ProtocolLib
as I said, not all those methods you need to implement but they need to be present
Okay is it okay when these methods are empty?
up to you if you want to override any of them
well they can't be empty if they need a return
well, can just return null, but I think a couple of them methods do need to be implemented properly though
i don't know... I'd check properly before returning null anywhere
getPlugin needs to be implemented, that is easy just return your plugin π
onPacketSending doesn't need to be implemented since the packets being listened for are being received
so onPacketReceiving needs to be implemented
that is where the event goes π
onPacketSending you can just do {} and leave it empty
really it isn't all that hard
getPlugin needs to be implemented, that is easy just return your plugin π
@keen compass I will make it static but than it says I must remove the static modifier...
create a public method for the listener
these are all public methods
public Listener(Plugin plugin){
this.plugin = plugin;
}```
Yeah I know but when I change the Name I must edit all classes in the Plugin and also when I doesnt change the name because it isnt static
don't use a static then o.O
if you don't know how to pass a reference of your plugin you probably shouldn't be messing with packets
Okay ...But always I need to edit all classes where i used getPlugin
why do you need to edit all classes?
if you don't know how to pass a reference of your plugin you probably shouldn't be messing with packets
@keen compass I know but I dont even like it until now I always used static getPlugin its easier
There is 2 enchantments for loot @frigid ember
Enchantment.LOOT_BONUS_BLOCKS
Enchantment.LOOT_BONUS_MOBS
think fortune is for pickaxe, in which case you want the one for blocks
alright, be right back now
really need to finish these updates for windows π
Hmmm
@EventHandler
public void onSlimeSplit(SlimeSplitEvent event){
event.getEntity().setSize(event.getEntity().getSize() / 2);
}
This should split in half of size every time that splits am I right?
idk why isnt working
ClickEvent(ClickEvent.Action.RUN_COMMAND, ))
What I need to write after run_command^^^^
with /
Yes
okay thanks π
and I am back
@barren abyss is the event being fired?
Hi, I have a question about Spigit/BungeeCord. How do I redirect certain commands from one server to another on bungee? I have a server for auth only, but I want to change the password/email etc from other servers. Did someone already have that issue and how did you solve it?
Is the event being fired?
It is
@frigid ember
percentage = (x/y)*100
i'll put an out put message to say if it is
It should work assuming the slimes size is > 4
x and y are whatever values you determine
Iβd debug our just to make sure
Resources out of stone?
@kind crow something like a bungeecommands plugin might work
Can you provide an example
What exactly should that look like
Like the mcmmo skyblock feature?
Do you want multiple possible drops? Or just one?
It should probably be a map
Assuming you want custom probabilities per item
It should work assuming the slimes size is > 4
@torn robin ITS 16
@barren abyss lmk when you add debug messages please
Hello, i have FeatherBoard and i want to change my scoreboard called "scoreboard1" to my second scoreboard called "scoreboard2" by a command like "/scoreboard toggle scoreboard2".
How i can this ?
@torn robin I don't see where I can specify the server for the commands to run on
@kind crow it wouldnβt be plugin specific which one are you looking at?
@keen compass So i tried it and it du not give me my message in the Update Sign Packet Event The OPEN Sign Editor Event still work the only ERROR or WARN ist thisPlayer hallo5000 just tried to change non-editable sign
private Random = new Random(100)
public void percentageCalculator() {
int randomInt = randomGenerator.nextInt(100) + 1;
if (randomInt == ((x/y)*100)) {
//do something
}
}
@torn robin did you mean this plugin? https://www.spigotmc.org/resources/bungeecommands-custom-commands-aliases.20771/
@barren abyss try using the event.setSize method
@reef sparrow
good news though! You are making progress. Now you have some output π
https://github.com/AuthMe/AuthMeBungee
@kind crow
Yes but the bad thing is ive the same output before so The only Thing that dont work is the Update Sign Event
@barren abyss try using event.setSize
that dnst exist
It is structure related so should be helpful DKL
Yes but the bad thing is ive the same output before so The only Thing that dont work is the Update Sign Event
And I dont know how du fix it... @keen compass
You need to cancel the packet if you want to change what the sign is going to have @reef sparrow
@torn robin I'm already using that plugin. I don't think it had that functionality. I can't run authme commands across all servers and I didn't see that functionality in the plugin description. I think I need another plugin for that
@barren abyss for now can you try setting the size to a constant?
You need to cancel the packet if you want to change what the sign is going to have @reef sparrow
@keen compass wich packet?
the Update_Sign one
Oh okay
cancel it, then using bukkit api
@kind crow I think thatβs probably just a bad setup then, could you try using a database?
change the sign
only thing you need from the packet is to get the data you want to do whatever it is you are wanting with the sign
@frigid ember just look at it
its weird
It provides a thorough explanation and some great pseudo code
only thing you need from the packet is to get the data you want to do whatever it is you are wanting with the sign
@keen compass Okay thanks i try this
even if I just use: event.getEntity().setSize(1); the size is the CreatureSpawnEvent size
hm
@torn robin I'm using mysql. I don't think it matters because I only have authme plugin on my Auth server and AuthMeBungee on the bungeecord side. Other servers don't have authme (and should not have)
Ah @barren abyss didn't realize that setSize() is for the new size of the slimes that spawn
I suppose that makes sense because the original slime is removed
So the split slime still spawning with the setsize of the "CreatureSpawnEvent"
@kind crow I don't have that much experience with bungee so I can't help you out any further unfortunately
so what you do instead @barren abyss is do
setSize(size);
setCount(1);
this will then create a new slime for you with the size you specified π
all in one event
just make sure you run setSize() before you do setCount()
don't need two events, just use the slimeSplitEvent
but I need the slime to spawn naturally with 15
that is fine
set the size of the next slimes that will split to 15 by using setSize()
I'm gonna write a plugin for my auth server then. Is there a way to send a command from specific player and get the output in a variable?
and then right after that code
put setCount(1);
that will cause the event to spawn a new slime, AKA it split
What do you mean by output?
of 1 with the size you specified
then set it to size/2
It shouldn't, if setSize() dictates the next size of the slime if it dies
Can you write a little example for me?
then setCount(1) ensures that 1 slime will spawn from it if it dies
im a dumb fuck at this hour
When I type a command I get a response in the chat. Can I save that response of the exact command I run in a variable?
public void onSlimeSplit(SlimeSplitEvent event) {
int size = 7;
Entity slime = event.getEntity();
slime.setSize(size);
slime.setCount(1);
}
With packets yes but I'm not sure why you'd want to
but this will spawn splits of 7 all the time
I will send the response to my other server
they will not be half their size when you kill one
then make it so you can change the number then
you can grab the int from where you want XD
thats the problem, I cant if I cant touch both events at the same time
@barren abyss just try it, it if works you know that the size works that way
if a slime splits do you want it to double in size before it splits? ie two/four other slimes will spawn from that slime with the same size?
It just seems poorly setup Rundik
I'd probably rethink your server setup if you have to go through loops and hoops to get what you're trying to achieve
@barren abyss you are only using 1 event. You don't need 2.
if you want to ensure you get half their size all the time.
public void onSlimeSplit(SlimeSplitEvent event) {
Entity slime = event.getEntity();
int size = event.getEntity.getSize();
slime.setSize(Math.round(size/2));
slime.setCount(1);
}
now, the next slime will always be half or near half the size of the previous
@keen compass Here is my Code: https://hasteb.in/kikifuho.swift but it still dont work and the broadcast message on the end also dont be send
what you did there is what I have
but the problem is, that this code isnt making the natural slime to be 15
Main.signList.contains(block.getType())
thats why I need to take the event when it spawns naturally and not by split
signList contains all Sign Materials
@barren abyss difference between mine and yours is that I am making use of setCount() which will spawn a new entity from the old slime
@reef sparrow did you make sure signLoc is what you're expecting it to be?
@torn robin I don't think it's a poor setup. Bungeecord has channels for the plugins to exchange the information. I will send the command I want to run to the auth server and get the responce from them. It looks simple. Or do you mean it's difficult to extract the command response? Can I do that without parsing the chat?
afaik you can't get a command response from a command run ingame without parsing chat
the better use would be an api specifically made for that cause
Oh, you're right. Authme should have an api for that I think
Here a new Hastebin of my Code https://hasteb.in/ucelavoy.swift @torn robin @keen compass
@Hallo5000#2393 did you make sure signLoc is what you're expecting it to be?
@Hallo5000#2393 did you make sure signLoc is what you're expecting it to be?
@torn robin Ive send you a new Hastebin in it are the Code of the signList i think its right
This is another problem but its not so bad ...I dont can debug it dont work but i think its not so bad
You can't debug (it's not working) or you don't know how?
if you don't know how it's trivial, just use System.out.println or otherwise a way to send a message to yourself
Okay so i can do this i think you mean the debug mode from any IDE
no
if you don't know how it's trivial, just use System.out.println or otherwise a way to send a message to yourself
@torn robin Wait i try this
yes
I can't spoonfeed you every line of code
I have pretty much gave you all you needed. It is up to you to get it to work
Not hard to debug where you are going wrong
you might have to update the blocks' blockdata
I insert debug texts every code block @SuppressWarnings("deprecation") @Override public void onPacketSending(PacketEvent e) { System.out.println("PacketEvent-------------------------------------------------"); if (e.getPacketType() == PacketType.Play.Server.UPDATE_SIGN) { System.out.println("if UPDATE_SIGN-------------------------------"); PacketContainer packet = e.getPacket(); e.setCancelled(true); try { System.out.println("Try ----------------------------------------"); List<String> lines = packet.getStrings().getValues(); Location signLoc = packet.getBlockPositionModifier().getValues().get(0).toLocation(e.getPlayer().getWorld()); Block block = signLoc.getBlock(); if(Main.signList.contains(block.getType())) { System.out.println("if Block is Sign -------------------------------------------"); Sign sign = (Sign) block.getState(); sign.setLine(0, lines.get(0)); sign.setLine(1, lines.get(1)); sign.setLine(2, lines.get(2)); sign.setLine(3, lines.get(3)); } Bukkit.broadcastMessage(lines.toString() + "-----" + signLoc.toString()); System.out.println("broadcast--------------------------------------"); }catch(Exception ex) { System.out.println("Catch------------------------------------"); ex.printStackTrace(); Bukkit.broadcastMessage("CATCH"); } System.out.println("End--------------------------------------"); Bukkit.broadcastMessage("Server UPDATE_SIGN"); } }
you might have to update the blocks' blockdata
@torn robin Yes i try this too
@keen compass @torn robin So ive insert some debug messages https://hasteb.in/ejukodib.swift and also ive cancelled the Event but the only debug messages in the Console are "PacketEvent-------------------------------------------------" and "else at Begin ------------------------------------------" so the if blocks it ...
Hello, i have FeatherBoard and i want to change my scoreboard called "scoreboard1" to my second scoreboard called "scoreboard2" by a command like "/scoreboard toggle scoreboard2".
How i can this ?
@reef sparrow just keep modifying your code until it outputs your debug stuff. Also you don't need a try catch either I don't think
not necessary to use try catches if it isn't going to produce an exception
It outputs the debug messages but not all beacause the first if clause returns false ...i dont no why
Then change it to so you can see what blocktype it is actually getting
yeah remove the try catch, and then output Location signLoc to the console
so you can see what location it has
I would do the same for every data type so that you can ensure that what you are expecting the data to be, is actually what you think it is
Okay i try this out
If for some reason it is different, then you need to figure out why it is different
odds are the location is the block under the sign
or if its a wall sign, the block behind the sign
which means you need to modify how you are getting the location for the sign to do your changes
but you won't know until you debug the data types π
Need to get use to doing this stuff because a lot of the times, just doing this you can usually solve your own problems before coming here for help
And this is how you get better at programming as well so, just take this as a learning experience π
it gives me this packet when i click on done TILE_ENTITY_DATA[class=PacketPlayOutTileEntityData, id=10]
it gives me this packet when i click on done
TILE_ENTITY_DATA[class=PacketPlayOutTileEntityData, id=10]
@keen compass I dont know why this packet is called
https://wiki.vg/Protocol#Block_Entity_Data
@reef sparrow
that packet is that ^
although the id shouldn't be 10 though
it should be 9
But the ID of the Packet is 10
The console give me this when i press done @keen compass [13:41:54 WARN]: Player hallo5000 just tried to change non-editable sign [13:41:54 INFO]: PacketEvent------------------------------------------------- [13:41:54 INFO]: else at Begin ------------------------------------------ TILE_ENTITY_DATA[class=PacketPlayOutTileEntityData, id=10]
@frigid ember You dont send us the code or something so nobody can help you
@reef sparrow its fine if its 10, its unused according to the protocol, the only other thing I can think of is that the packet is being sent as part of a block change packet
in which case, the id specifies the direction it is facing
@frigid ember it would be more helpful to see what you have so far
Ohh yes because in the addPacketListener Method ive written that this PacketListener only accept the UPDATE_SIGN Packer
?paste
this is a community effort. There is a chance that I might not know how to solve your problem, but if you paste what you are having a problem with, it allows others here to also contribute their wisdom or thoughts on it.
yo is someone able to tell me If i'm doing it wrong
why does it keep saying 'unchecked operation?' I've marked the constructor with ClassCastException
can someone send me hastebin
@sturdy oar you canβt just cast from a string to T, you have to parse the string into your custom object type
The string wonβt be of type T so that will throw an exception every time
if(e.getItem() != null && e.getItem().getItemMeta().getLocalizedName().contains("staff3")) {
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
cooldown.put(me, (System.currentTimeMillis()/1000));
if((cooldown.get(me) + 5) >= (System.currentTimeMillis()/1000)) {
ItemStack stuff = e.getItem();
ItemMeta em = stuff.getItemMeta();
em.setCustomModelData(3);
em.setUnbreakable(true);
em.setLocalizedName("Staff1");
stuff.setItemMeta(im);
me.getItemInHand().setItemMeta(em);
me.updateInventory();
loc = loc.add(loc.getDirection());
new BukkitRunnable(){
@Override
public void run() {
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
loc = loc.add(loc.getDirection());
while(loc.getBlock().getType() == Material.AIR) {
loc = loc.add(loc.getDirection());
world.spawnParticle(Particle.FLAME, loc, 0);
world.playEffect(loc, Effect.BLAZE_SHOOT, 4);
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}
}}.runTask(new StaffWeapon());
}
why doesnt this work
` <- use that
` if(e.getItem() != null && e.getItem().getItemMeta().getLocalizedName().contains("staff3")) {
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
cooldown.put(me, (System.currentTimeMillis()/1000));
if((cooldown.get(me) + 5) >= (System.currentTimeMillis()/1000)) {
ItemStack stuff = e.getItem();
ItemMeta em = stuff.getItemMeta();
em.setCustomModelData(3);
em.setUnbreakable(true);
em.setLocalizedName("Staff1");
stuff.setItemMeta(im);
me.getItemInHand().setItemMeta(em);
me.updateInventory();
loc = loc.add(loc.getDirection());
new BukkitRunnable(){
@Override
public void run() {
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
loc = loc.add(loc.getDirection());
while(loc.getBlock().getType() == Material.AIR) {
loc = loc.add(loc.getDirection());
world.spawnParticle(Particle.FLAME, loc, 0);
world.playEffect(loc, Effect.BLAZE_SHOOT, 4);
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}
}}.runTask(new StaffWeapon());
}
done
close but
No 3 of these ` at the end and begin
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
cooldown.put(me, (System.currentTimeMillis()/1000));
if((cooldown.get(me) + 5) >= (System.currentTimeMillis()/1000)) {
ItemStack stuff = e.getItem();
ItemMeta em = stuff.getItemMeta();
em.setCustomModelData(3);
em.setUnbreakable(true);
em.setLocalizedName("Staff1");
stuff.setItemMeta(im);
me.getItemInHand().setItemMeta(em);
me.updateInventory();
loc = loc.add(loc.getDirection());
new BukkitRunnable(){
@Override
public void run() {
Player me = e.getPlayer();
Location loc = me.getEyeLocation();
World world = me.getWorld();
loc = loc.add(loc.getDirection());
while(loc.getBlock().getType() == Material.AIR) {
loc = loc.add(loc.getDirection());
world.spawnParticle(Particle.FLAME, loc, 0);
world.playEffect(loc, Effect.BLAZE_SHOOT, 4);
for(Entity ent : getEntitiesByLocation(loc, 0.545f)) {
if(ent instanceof LivingEntity) {
((LivingEntity) ent).damage(10, me);
((LivingEntity) ent).setFireTicks(10);
}
}
}
}}.runTask(new StaffWeapon());
}```
Perfect
well you keep putting the cooldown over and over again? so it will never run
Another Question How i get a single line https://wiki.vg/Protocol#Update_Sign all lines are at the same Field @keen compass ?
well it think I know how to solve
I'll have to move the constructor to the classes implementing the abstract class
Because they don't have generics and I can parse there
And how i get a string out of a Field
hello, where do i set a new image to my bungeecord server ?
@reef sparrow its a list<String>
