#help-archived
1 messages Β· Page 204 of 1
yep
Yeah, by minecraft
Minecraft ships JDK 8 with it, however that doesn't mean minecraft can't run on java 11 or higher
You can all drop j8 support and start compiling on j11
minecraft ships jdk 8for only one reason
Java 14 officially supports Java 8 code and can compile for java 8
J11 runs minecraft just fine.
I always compiled to Java 8 for compatibility. Never tried anything higher.
Newer versions of java has more interesting developer funsies
that already was in kotlin like years ago yay
Yeah, I would like to use some of the newer features of Optionals
J8 is missing a lot
buildtools can't build 1.8.8 without java 8
Use kotlin or scala π
^
The main reason jdk 8 is shipped with Minecraft is so that users don't need to install Java and second it is also due to licensing as well
i wanna cry
Do you guys have transform mods where players can turn into another entity?
@keen compass https://github.com/LWJGL/lwjgl/issues/119 :)
Libsdisguise
they ship exactly jdk 8u25 due to driver issues
because intel's drivers only support windows 8.1
after u25 windows 10 support was added and drivers broke
OpenGL drivers?
I have already addressed this issue before
and I already know the workaround for it
yes to patch java.exe manifest
The issue is not LWJGL
and no you don't need to patch java, but you can if you want to
I think the problem is when I parse the BlockEntityTag and get the items, I'm using Material.matchMaterial, yet the api level is set to 1.13 and the order of the spigot versions in the dependencies starts with the lowest at 1.13-R0.1
not required to solve the problem
what is required?
the problem is due to the low memory being allocated to the GPU
Those are integrated GPU's
dude it's literally a bug in drivers
If you have api-level set to anything but the newest it will active legacy materials
what do you mean
its not
It might be messing with your matching
what is batter intellj idea or eclipse
Anyways, with integrated GPU's they don't have their own discrete Ram to use
I prefer IntelliJ
but that doesn't mean iGPU's get to make use of all available ram either
the OS/BIOS has to set aside a certain limit of ram for the GPU to use. Which can be changed in the BIOS in most cases
dude are you trolling
by default the GPU is set to consume not a whole lot of ram
dude are you trolling
does the bios not control how much ram the iGPU gets?
if you want to prove me wrong on that, go for it
i'm speaking about the issue i linked above lol
I personally use an iGPU. If that wasn't the case, then why is it a bios setting?
so am I
and I am telling you why it is an issue
It is a hardware problem, not a software problem
Who
Don't need to, because I have already discussed this at length with various other people and this is how I know the work around without patching anything
wtf
But hey you are the hardware expert though so don't listen to me π
if you are going to banter on about jdk versions and gpus can you go to general
I can't see responses
or continue your brofest in a pm?
@inland oxide If your api-level isn't set to the latest version, it will activate Legacy materials. That might be causing your issue.
idon't want to continue this lol
Nothing you have stated contradicts what I have stated
can two different plugins not use commandmap?
this dude is either trolling or he is stupid
lol
@bronze acorn yes they can
unregister?
are you sure that the order is correct?
so, if I set an api-version: '1.13' to support 1.13+, then any methods that use newer functionality doesn't work?
maybe the commands are registered after you attempt to unregister them?
run your code to unregister commands on next server's tick
in onEnable
that will solve the problem
It seems your code is matching materials based on their name. And spigot has a legacy mode for materials for older, pre-1.13 plugins
I'm just saying that legacy mode might have different names than you are expecing
well my plugin is just trying to support 1.13+
it's not that they wont unregister onenable, its
when the plugin disables
the command still stays
you did not associate it with the plugin then
What version are you on though? 1.16?
see PluginCommand
but seems that the Material based api calls might be specific to the api version used.
so how to use for a plugin that supports 1.13, 1.14, 1.15, 1.16
or are we forced to make new plugin versions every time.
You have to make a new plugin version
For each version
At least, that's what I do
no, thats not why there is bukkit.
i mean, it's a conundrum
if I use api-version 1.13 for cross compatibility, then new functionality is not available unless I check version and call nms
I don't think Spigot ever guaranteed you'd be able to make plugins supporting multiple Spigot versions
if I use api-version 1.16, chance that exception occurs or missing method
no, but concept of a bukkit api was that it would work on later versions
concept of nms doesn't provide portability across versions
The biggest issue I'd see is that new methods get added to classes between versions, some get deprecated or even removed. How do you plan to track that?
but to use new features in the api, i'm losing portability and only way to solve is with nms
You really shouldn't use NMS for detecting different Spigot versions and adapting to them
its ironic.
You'll have a far simpler time just compiling a working version of your plugin for each version you want to support
i'm not making a build for every version because the api changes and doesn't consider that materials change.
They don't really change that much between version. Well, except 1.12 - 1.13
apparently they changed between 1.15 and 1.16
Well, I wish you luck then, because you're in for a difficult road.
should have used datapacks
lol
π
should have used enums
still not sure if its the api or if its just changed from 1.15 to 1.16
if it changed, i can rewrite the id
but if its just missing, well.
hey
can help me
18:30:28 [SEVERE] Exception in thread "main"
18:30:28 [SEVERE] java.lang.IllegalArgumentException: Server Spawn (priority 0) is not defined
18:30:28 [SEVERE] at com.google.common.base.Preconditions.checkArgument(Preconditions.java:359)
18:30:28 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:135)
18:30:28 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:272)
18:30:28 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
18:30:28 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
so, can't create an itemstack with a material if the material isn't supported in the api-version, right?
Why do you need to?
and if use api-version newer than that version run on, then doesn't load
so, only option is to make redundant code??
What is your actual issue?
I need to be able to match/create a material based on a key that might be different with the version the plugin is running on
Which material is it that's changed name since 1.13?
Yes, and what's the actual issue?
Maybe do a Material.valueOf()? Though I'm not sure that would actually make it work
You can simply null-check the results and ignore materials that don't exist
There is no enum in material if the api-version is set to 1.13.
And print out a warning in the console
I can't
The problem is that they don't exist in the api-version but do exist on the spigot version
so I'm not sure if its failing or just warning
but regardless, probably returning a null for material
so itemstack is not created
I'll have to retest, but point is that can't have a Material that doesn't existing in the API that does exist in spigot.
So how to make plugin support multiple versions
Just because you set the API version to 1.13 doesn't mean the BEEHIVE enum constant won't be there at runtime (in 1.15+)
hmm let me test that theory.
It's not a theory, it's fact.
Setting it to 1.13 just avoids the bytecode manipulation it does to support "legacy" shit.
1.13, 1.14, 1.15, 1.16 is all the same
1.13 works on 1.13->1.16, 1.14 works on 1.14 -> 1.16, 1.15 works on 1.15->1.16, 1.16 only works on 1.16.
Try giving api 1.16 and put it in a 1.15
Not entirely "all the same". You should treat it as a minimum requirement. Meaning api-version: 1.15 is not the same as api-version: 1.13 as the former is not designed to work on 1.13
All the same mostly, it was added to avoid the bytecode manipulation for legacy shit, and not specifically for you to decide on which version it was suited for, i guess that's just a side effect.
what is the alternative for something like Material.AIR.createBlockdata() on 1.8?
is it Material.AIR.getData()
so these warnings, I'm guessing are from when the api is trying to match or create an itemstack and the key is for somthing that doesn't exist in the api, but you think it will succeed anyway?
Which errors?
I get what you mean. The only meaningful difference is that when you specify a (meaningful, i.e >1.13) API version is that the compatibility layer is not used. However, plugins with API version defined for a newer version of the game will not work on older versions
If you specify an api-version it will just try to fetch it from the material enum, if you don't they will get converted to that legacy bullshit kluge.
what is "Levelled" ?
It is there to convert legacy material enums of plugins to modern usage.
And it has a side effect of also disabling usage on higher versions 1.13+ if you define a higher version.
right, so then what is throwing the warning?
The plugin doesn't kepp track of which materials are available for the api version you define.
As said here within the last few minutes multiple times, all it does is make sure the legacy (pre 1.13) materials are not used
What warning are you talking about exactly then?
[11:36:16 WARN]: Unable to resolve BlockEntity for ItemStack: minecraft:spawner
[11:36:16 WARN]: Unable to resolve BlockEntity for ItemStack: minecraft:bee_nest```
That's from DataConverterSchemaV99
I can only guess that it has something to do with my plugin loading the serialized itemstack from the database and creating the itemstack for a container such as a shulker box that contains other itemstacks in the BlockEntityTag for those items.
Can a smelting recipe have more than 1 as the result amount?
The data being written in 1.15.x and read in 1.16.x
@wheat mirage Since the result is an ItemStack, I don't see why not
It probably won't with the default api tho
Try
And the amount is currently 60
I think it may clip and give either an unsafe amount
or bug in unexpected ways
@inland oxide
The warning is a vanilla MC isssue:
https://bugs.mojang.com/browse/MC-152265
https://bugs.mojang.com/browse/MC-122995
Has nothing to do with your plugin or Spigot
this isnt getting called even if at world test - String world = BlockPure.getWorld().toString(); if(world.equals("test")) {
i just got the ultrachest plugin and i seriously cant figure out why the items i chose wont go into the chest i choose
you convert worl to a string
ive tried for an hour now
yeah, i just want its name
i did all it said was that to do /ultrachest register and it would put it in the chest
it didnt work so i did the chests direct name after it and it said it worked but it didnt
It doesn't look like a super popular plugins so I'm afraid you'll probably not have much luck finding someone who has experience with it.
You might want to simply contact the developer
okay thanks anyway
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
OK, so i retested with some code to see what was actually being pulled with the material and its all working fine with the 1.13 version API even for the spawner, beehive and bee_nest. Pretty confident that this is not in the plugin but a vanilla issue. Thanks for all the help!
I already showed you the vanilla bug reports as well...
Yes, I saw those, thank you.
But still needed to make sure it was working properly for those items.
And I said that it would...
but seeing it working just makes it all that much more reinforced in my mind.
now if I could only get my 1.8.8, 1.11.2/1.12.2 and 1.13+ plugins consolidated into an all in one
theres no way to have a plugin with modules that have different api versions is there?
No. But the API version is not checked at all for MC before 1.13
So you can just have it at 1.13 and provide a different implementation for legacy versions
so leaving it at 1.13, and then somehow wrapper around the plugin class to load a module that is version dependent?
Sure
so does that mean it's abstract?
You generally want to use abstraction, yes
Thatβs what i did for my 1.8->1.16 reflectasm treetwerk plugin
gosh i need better names
or better ideas
maybe I should make a plugin that allows stuff to be shot out when you twerk
?paste
wow, self-help
at com.javaminecraft.Elytra$3.run(Elytra.java:268) ~[?:?]
so does the twerk plugin have the plugin class as abstract or some sort of interface, how does that work exactly?
You simply use abstraction.
Generally, you have an interface that defines the behaviour.
And then multiple implementations for different versions you're planning to support.
These implementations may need to be in different sub-modules if you want to depend on a different version of the API
right, so if I have a Wrapper interface it can extend JavaPlugin and implement Listener and have the main, onEnable and other methods?
or I do I leave the entry point it's own and abstract out everything else
You can only ever point to one class in your plugin.yml
So the abstraction needs to be a separate interface
But that's generally needed anyway for SRP
right, can't point to an interface, so then i have to make PluginName as entry point, then all the methods are stubbed and call the interface method in the wrapper
Kind of like what I'm doing now, but I only abstract for the nms methods
might be easier than I thought.
just need to figure out the gradle sub project stuff
ok, well time to sleep.
Would anyone know how to disable coordinates of players on the "dynmap" plugin?
I'd assume there would be an option in the config
Then again
You don't really need the coords if you can see them anyways
I've disabled the link and coordinate display features, but I can tell that coordinates are still getting sent, because players have found ways to get coordinates of players easily from devtools. I have searched the config for any option to disable sending coordinates and came up empty. If someone had a solution by modifying one of the web js or server-side web server files, I would settle for that at this point.
I'd assume that it kinds needs coordinates to figure out where to display people
How would it know where to display people if it doesn't get their coordinates?
maybe they could have an offset as a temporary measure?
You could probably edit the source of the plugin itself to skew the coordinates by a random number or smthn
well it seems all the web server-side code is in the dynamp plugin folder under web folder
oh please don't tell me you're using the internal webserver
well if a troll spam reloads the page, it can slowdown your server
Doesnt the server run on a seperate thread? So this is not true.
small time server, so I'm not concerned about that right now as my immediate concern is people easily grabbing player coords...
I think the cords are attached to the chunk image
so players would still be able to find them out
or at least the chunk numbering is attached
then they could use dinnerbone's tool
to find the cords
Best bet is probably to skew the coords before they reach the web server
Β―_(γ)_/Β―
if you're that concerned, don't show players
is there any way to change this in the web server files?
What exactly is the problem here?
he wants to hide cords on his map
He doesn't want people to be able to get coords from dynmap
yes
Only real way to do that is to display incorrect coords on the map itself
@stoic shell I checked my online map, and the chunk numbers are visible
you can see the 24 -18
So either messing with them before they get sent, or finding where they get received server side and adding a random number to it
I've looked, but there are a lot of files
yeah, so the chunks could be randomly offset every time a player loads the the map, right?
oh okay
I'd recommend making a fork of dynmap, so for every update you can just merge from the higher repo
if you plan on editing the plugin
They do have a github repo
yeah
I was planning on just changing something in the web folder, and keeping a backup of that to restore after dynmap updates
someone know how to get a different domain for a spigot server?
but I can't find where to change to offset them
Like play.example.com? @abstract shard
yes
someone know how to get a different domain for a spigot server?
You need to buy a domain
do you have one?
Domains are cheap, usually 12$
Buy a domain then set an A record
my .com domains are 8.56
4.15 for the first year
or
you have a website you can recommend for getting domains
I could fork it, but would anyone be able to help with changing the neccesary parts?
ok
It cost like $10 a year
Porkbun is more affordable
But it mostly comes down to opinion once you start getting lower than $10
name.com is $13/year whilst porkbun is 8.56/year
Wtf they increased my price
F
Without telling me
Switch to porkbun, you won't regret it
Porkbun has amazing support imo
But then I have to tell my parents to move my domain over
your parents manage your domains?
And they wonβt care
my parents don't even know what a domain is
My parents have a crap ton of domains
cool af parents
My mom bought like 15 domains in 1995
She lost a domain worth 10k when she forgot to renew it π¦
big F
@EventHandler
public void onPlayerMobInteract(PlayerInteractEntityEvent e) {
if (e.getRightClicked() instanceof Horse) {
Player pl = e.getPlayer();
UUID uuid = pl.getUniqueId();
Entity ent = e.getRightClicked();
World world = e.getPlayer().getWorld();
Location entloc = e.getRightClicked().getLocation().add(0,1,0);
Entity vehicle = world.spawnEntity(entloc, EntityType.BOAT);
storedNames.add(uuid);
new BukkitRunnable() {
@Override
public void run() {
if (storedNames.contains(uuid)) {
vehicle.teleport(ent);
}
}
}.runTaskTimer(this.plugin, 0L, 1L);//20=1s
vehicle.setPassenger(pl);
}
}```
makes me passenger of the horse
not the vehicle :/
i would've held that for millions
Lol
Please donβt put the stack trace here
Put it in pastebin
They probably could've got their lawyers to do something
And thatβs always scary
Better π
That is btw not a stack trace ^^ I think code fragments of this size are fine
Isn't it better to use the mount event π€
@frigid ember Do you cancel the runnable somehow?
the runnable doesnt do what its supposed to be
It teleports a boat to the horse?
because this looks like it will destroy your tps.
the boat just has to 'follow' the location of the entity
move the same way
without the boat being passenger of the entity
It just stay in one place right?
Yeah... you have to set a variable to the horse's location and then teleport the boat to that new location inside that laggy Runnable
Also throwing around anon. BukkitRunnables like that is bad practice. You should only need one single Runnable for this task.
uuid hashmaps, key is the player uuid, value is the horse uuid π€
Is there a way I can programmatically insert a comment block at the top of a YML using YamlConfiguration?
What do you mean by "insert a comment block at the top of a YML"
oh comment block woops i read command block XD
Not with the YamlConfiguration api.
I'm creating a lang file like this: ```lang-file:
==: Chests++ Language File
TEST: This is a default message {0}
You need to write your own file parser for that.
The existing YAML implementation only allows a header - a comment at the top of the file
Oooo it does?
You can link to your wiki in the header or just write your own yml file manager. Yaml isnt that complex rly.
declaration: package: org.bukkit.configuration.file, class: FileConfigurationOptions
the runnable works now but
i'll still be passenger of the entity first
horse in this case won't happen with other entities
oh, unmount the player from it
Using?
Horse#eject()
anyone here know how to make animated guis?
just messing around trying to figure it out lol
new BukkitRunnable() {
int i = 0;
@Override
public void run() {
getInventory().setItem(i++, new ItemStack(Material.IRON_LEGGINGS));
Bukkit.getLogger().info(String.valueOf(i));
if (i == 8)
{
this.cancel();
}
}
}.runTaskTimer(SocksHub.get(), 0, 20);```
is what i have currently
I this a runnable for each inv?
wdym
Do you start a runnable for each gui
this is my only gui currently
what i mean by animated gui
like have an item move across the inventory
by itself
Does every player have the same inventory instance?
I would highly recommend that all of you stop using anon. BukkitRunnables like this. I see this at least once per day.
In your case you should have a manager singleton that keeps track of every gui and tick them.
Also if you only move the item across the screen then the player wont be able to just click it.
There are a lot of approaches and the ones that are modular and scalable use a bit more advanced java.
@bronze acorn Yiou should try Kotlin plus Skedule
I use Bukkit Runnables but it's for action bars and combat tag >:)
Or TaskChain if you want to write in Java
What's wrong with that type of bukkit runnable? I've never had an issue with it
But with kotlin coroutines it's much easier to make stuff like animations
np ^^ and dont jump into Kotlin just for that.
@opal adder Code looks ugly.
Other than that
@opal adder It is a pain to track them down when you use timings or a profiler.
uh nothing i guess, but it becomes very spaghetti eventually
What do you think is better then?
If you have one that leaks you will have a hard time to track it down
skedule is hot
Like... actually properly implement Runnable in a class and run it with the BukkitScheduler
Oh you mean like, create a class object for the runnable, so that the instance of that class is what is running, so I only ever have to call one? Maybe I'm mis-understanding.
Skedule... is not a replacement for TaskChain
Why not lol?
It's a library in java
^
Implemented on bukkit
https://github.com/aikar/TaskChain Ehm, it's sortof different.
Oh it's an API
yes
@opal adder You should generally dont throw runnables around. I hardly have a plugin that uses more than one or two instances of a Runnable.
Yust one runnable that keeps track of a data structure of tickables.
Skedule can do most of the things that TaskChain does but its not a complete replacement.
Are you intentionally spelling that wrong?
You mean Skedule ?
Yes
Yes its the name of the library
It's this https://github.com/okkero/Skedule/
Also what deos it not have 7smile7?
It has a wait, it has a context switch and it can repeat.
shared task chains for example
or something like null abortion (null is not rly a kotlin thing anyways)
So the Skedule is one instance of a runnable?
Dont worry about Skedule.
Its nothing you have to know unless you write your plugins in Kotlin and want to chain sync and async tasks
Well, I'm trying to think of the best system here, because I have a playtime plugin and I want it to track if an individual users playtime reaches <x> time. I already know how to do this via a runnable, but that would require me making a runnable per player. Which is probably not ideal.
What i mean is that you should write a manager for tickables.
Today i wrote a small example for projectiles. Because someone started a runnable for every projectile that did load chunks inf in every direction.
Its very basic but it shows the idea. One instance of this singleton that manages a collection of tickable objects.
okay I'm having some trouble with the dragon egg lol. I'm using PlayerInteractEvent to check when they click the egg and everything works, but I'm wondering how I can actually delete that block? I have it set up so it spawns in the players inventory when clicked, however, I want the egg to disappear from the world
event.getClickedBlock().setType(Material.AIR);
Yes i would try it like this. Just make sure to cancel the event.
oops I did that, but I put it in the BlockBreakEvent lol
When you add it to their inventory, remember to make a check for if it's full. You don't want to just do addInventory
@opal adder To your task above.
I think you dont need millis precision right?
No, actually for what I'm doing I only need minutes
Can you guys help me with this too? https://hastebin.com/sigozuhuro.cs it doesn't teleport them when they stand on a diamond block.
Wait ill write you a quick example on how you would do a ultra light tickable that scales way above 200 players.
You aren't checking the type
Oh damn alright xD My original think was just a runnable per player, but if there's a better solution I'm all open to that
so I would do getBlock().getType().equals()?
Yes
I'll try it now thanks!
You could also shorten that by checking the blockface.down
how would I do that?
Just use the player location, no need to create another location reference
location.getBlock().getRelative(BlockFace.DOWN).getType().equals(Material.DIAMOND_BLOCK)
Hello, how is the command to let people build ?
ooohhhh thanks I''ll try that first because it does look better than creating a new location
./op?
Yea, I mean you could a block for it, to shorten the code and make it look prettier, but that's how I do the jumpy sponges in my hub
well, emerald blocks actually
yes that works but i dont want everybody to get op xD
I mean it depends on what you mean, like for creative mode?
yes
I mean that question is really dependent on the situation
but just for creative mode, /gamemode creative <player>
did i need a plugin?
I'm guessing that player doesn't have permission t place blocks, probably because you're using essentials antibuild?
I don't use that plugin
I hate that plugin
everything works thanks guys!
Np
Don't, the only plugin from Essentials I use, is essentials and essentials chat, I don't use anything else
delete it?
I mean you only need worldguard for like spawn protection
I'm not sure why that plugin even exists, maybe it has a purpose?
ok i try it
Hello, quick question, if I want to get the actual name of a block and not just the 'material' (for example "LEGACY_REDSTONE_BLOCK"), cuz I want "Redstone block", how would I convert a block type to that?
i have a backup if anything hapen
Youβll have to do some string manipulation
Its name is not readily available to the server. Everything is localized on the client
The best you can do is get the registry name, Material#getKey(), replace the underscores with spaces and you've got the best you can have on the server
Make a method that removes all the underscores and removed βlegacyβ and capitalizes first letter of sentences. At least thatβs how u know to do it
Okay
Also, if you're explicitly using legacy names, you're doing it wrong
You should never use any legacy constant in your source, period
Then why does the legacy exist?
1.12 constants are mapped to these legacy constants with ASM for forwards compat
Γ€hmmm a lot of informations xD
?paste
how would you check for a certain item in an entire player inventory
Location entloc = e.getRightClicked().getLocation().add(0,1,0);
Entity vehicle = world.spawnEntity(entloc, EntityType.BOAT);```
@blazing burrow Inventory#contains || Inventory#containsAtLeast
the boat has to stay at the location with 1 added to y
now it'll just fall down
Does anyone know of an updated plugin that prevents players from going to the nether roof?
@opal adder Ill post a manager that ticks a player in an even distributed workload.
It will split the players into multiple collections and only tick some of them every tick.
It kind of looks like this:
Hello , i found more information about my yesterday's issue, the thing is zombified piglins never aggro players when they hit em. They do move but they dont aggro. Do someone have any idea how to fix it?
Btw when i spawn one in the overworld, it works.
It doesn't on the nether
Thats not quite a UML diagram but yes ^^
I like doing diagrams of my code so much
Intellij has a rly nice feature that lets you generate UML diagrams from your code
π
Location entloc = e.getRightClicked().getLocation().add(0,1,0);
Entity vehicle = world.spawnEntity(entloc, EntityType.BOAT);```
So the boat should stay at 1 added to y
but it just falls down now :p
which is logic
but is there a way to keep it 1 above (the mob)
π
if(!(joined.getInventory().contains(Material.COMPASS))) is this syntactically correct?
Depends on what you want to accomplish. If you want to check for any stack of Compass, then that should do the trick
Sorry am back, interesting, that's a bit confusing to me tbh, I'll have to look at it a while
@sturdy oar This for example is a UML diagram from my old server that i wrote.
@opal adder Dont think about it too hard. You can also just go into the run method and do your
for(Player player : Bukkit.getOnlinePlayers()) stuff and check each one every tick...
Just dont start a runnable per player
.forEach(p -> ...) Recommended
or write a method "check" that only takes a player and then call .forEach(this::check)
But if you don't know lambda and collection for each is fine
Alrighty, I'll try to figure it out, thank you!
Could this cause trouble if ran async? primary.getWorld().getBlockAt(x, y, z)
Make it ride the mob or smth
guys i had a general question about the events
in public void onEntityPickupItemEvent(EntityPickupItemEvent event) is it the method name or the parameter thats responsible for executing the code inside the method (and is it the same with other events)?
@abstract swallow Forge and Spigot are not compatible (read: you can't)
how do i make a server that can run forge BUT also uses plugins
@blazing burrow The name is irrelevant. All you need is the @EventHandler annotation and the parameter that extends Event
@abstract swallow You'd need to ask the people at Forge
why'd you wanna call an event in another event
okay thanks @wraith thicket
And you'd obvisously need to register the listener
yes yes
and implement Listener
Yes, hence I said "register the listener". Plus, you can't register something that doesn't implment Listener
true
yes
if i want to check what type of entity a certain entity variable is then what would i use?
depends on the event
@blazing burrow to check for entity type, if the event provides you with an entity, you would check if the entity is instanceof EntityType
declaration: package: org.bukkit.event.entity, class: EntityPickupItemEvent
LivingEntity ent = event.getEntity();
will get the picked up entity
there used to be a Material.getMaterial(int id);
uh what's the alternative for that
to still get it using an int
Material.getFromString()
anyone know how to get the actual minecraft block class from the bukkit block ?
using an int?
why an int?
Hey, is there an overview of the major changes to the api in 1.16.1? If so, any link is appreciated.
because of ids
@bronze acorn i think ur talking about id
not in 1.8
in 1.15 they are.. crap
and 1.9/1.10 I believe
declaration: package: org.bukkit.entity, interface: Entity
doesnt say deprecated tho
Β―_(γ)_/Β―
oh F
how do you get minecraft block from bukkit block?
you might be able to cast it, idk
I tried that
oh okay
it gives errors
bukkit block so stupid an kinda pointless
and well
you can't do anything specific in it
wdym minecraft block from bukkit block?
just do Block.getType();?
lazinq isnt there an entity nbt to prevent falling? if i remember correctly there is
declaration: package: org.bukkit.entity, interface: Entity
Entity.setGravity(false);
;)
wat
are there event handlers for blocks on net.minecraft.server?
@warm stirrup sorry for not replying earlier. The block that you get from event handlers in bukkit is from org.bukkit.Block not net.minecraft.server.Block
I wouldn't really mind the bukkit block type but its shit and is missing a lot of functionality that I would get otherwiser
All those events you see are manually called when a action happen internally they arent a source code thing
can you convert from entity to player
cast ^
setVelocity*?
@warm stirrup will set the speed right?
Hello, I do not know if it is an error due to optimization, but in Minecfrat Java they made a change in which to repair an item by having it on hand you did not receive xp until it was completely repaired, with Spigot I receive the experience and it is difficult To repair the article, I would like to know if there is any way to solve this or if it has to do with the configuration of gathering xp orbs?
Sorry for my English It's not my language
Someone?
yeah but you can set it so its not moving
minato, you are referring to the Mending enchantment?
the item you're trying to repair has Mending right?
Yes,
@warm stirrup when u said cast ^ were u replying to my question
or was that to someone else
yes
minato as far as i know mending works on spigot 1.16
you can just Player player = (Player) entityObject;
it works but it doesn't work in the same way, normally if you have an item to repair this take the xp but I get it sometimes and it takes a long time to be able to repair
how would you check for a certain item in an entitys inventory?
cause entity.getInventory() doesnt exist i believe
oh wait
so if i have Entity pl = event.EntityType() how would i use pl in that way?
'setPassenger(org.bukkit.entity.Entity)' is deprecated ```
why is setPassenger deprecated in 1.16.1
and not in 1.8.8 ;|
whats a good way of storing custom items
alguien q hable espaΓ±ol?
hola
that was all spanish I can speak :/
Atin, if you're trying to get the inventory of a player from that event then maybe use
if (event.getEntity() instanceof HumanEntity)?
Lazinq, you can use Entity.addPassenger()
@molten mauve https://www.youtube.com/watch?v=quOPZE3noio
DESCARGAS:
Forge: http://files.minecraftforge.net/
WorldEdit 1.12: http://velocicosm.com/CFnv
WorldEdit tutorial | Descargar y funciones bΓ‘sicas | EspaΓ±ol 2016 | Minecraft | Single player commands | World edit
Β‘Cualquier duda o sugerencia en los comentarios!
SORTEO DE UNA...
ohh key ty
@warm stirrup but how would i assign it the value of humanentity to then be able to access the actual inventory
Cause i need like pl.getInventory thats just a condition
yeah but i cant do HumanEntity p = event.GetEntity();
HumanEntity p = (HumanEntity) event.getEntity();
@frigid ember ahi dice q es para forge pero en mi servidor usa plugins y es de aternos v:
you need to cast HumanEntity to it because it returns a LivingEntity instead
HumanEntity is a subinterface of LivingEntity, though, so you need to cast it to use its functions
at me.Lazinq.MobsDriver.objects.Driving.onPlayerMobInteract(Driving.java:51) ~[?:?]
lo siento no puedo hablar espanol mucho :/
@warm stirrup
vehicle.addPassenger(pl);```
ihh ok
whats the error lazinq
EventException
wdym by "cast" tho
any more information than that? ._.
?paste
what i sent was an example of casting
lo siento no puedo hablar espanol mucho :/
@frigid ember ok, no problem, what I was saying was that in the tutorial you sent me the worldedit was for forge and my server has plugins and it is aternos
Caused by: java.lang.NoSuchMethodError: org.bukkit.entity.Entity.addPassenger(Lorg/bukkit/entity/Entity;)Z
:v
worldedit tiene un version para forge pero es un plugin tambien
if you're trying to support both versions then you should maybe add either an if statement that checks the version or do a try/catch block for that then use the old method if the new one fails for that
@frigid ember but does it change with the forge and the plugin or not?
if you're trying to support both versions then you should maybe add either an if statement that checks the version or do a try/catch block for that then use the old method if the new one fails for that
@warm stirrup me?
yes
que no sΓ©, creo que es casi lo mismo
ok
so what i would do is
try {
entity.addPassenger(player);
} catch (NoSuchMethodError ignored) {
entity.setPassenger(player);
}```
yikes
it shouldnt be the same error...
} catch (NoSuchMethodError ignored) {
entity.setPassenger(player);```
2nd line
same error
world#regenerateChunk doesn't work in 1.16, are there any plugins or workarounds?
IDK
could you use the paste thing for the error?
?paste
could you use the paste thing for the error?
@warm stirrup
Is there a way for me to add an NBT tag without using a namespacedkey and all? Basically I need those two items (screenshot) to be the same, aka I need to add "repair-cost=1000" to my custom item so it matches the item from a different plugin. https://cdn.discordapp.com/attachments/721357671403487272/737412061327523860/unknown.png
why are you trying to use a constructor on a material?
Lazinq i dont know what to tell you. showing your code might help a bit
try {
vehicle.addPassenger(pl);
} catch (NoSuchMethodError ignored) {
vehicle.addPassenger(pl);
}```
52-56
omg
you're running the same function in the catch block which is why
lol
so what i would do is
try {
entity.addPassenger(player);
} catch (NoSuchMethodError ignored) {
entity.setPassenger(player);
}```
@warm stirrup trying to set the blastResistance to a block
if you could show me a better way please do
yeah but you might need to make a separate class for running under a specific version because its likely you'll get an error anyway that it doesnt exist
Dangit, spot the error
https://i.imgur.com/6zKgfW3.png
Whenever I kill a mob https://hastebin.com/owafucobaz.apache
@warm stirrup error for what not existing?
that wasnt to u
oh
27.07 23:07:38 [Server] INFO at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) ~[patched_1.15.2.jar:git-Paper-380]```
you should tag people so its clear
could u show ur code stoozy so i can see what you're trying to do exactly lol
@subtle wedge Preconditions.java line 122
I'm not writing code until I know whats possible
currently I don't have any clue as to how I would change the durability of a block in bukkit
you mean like a block placed in the world?
I tried looking at the javadocs but the block interface doesn't seem to have fields for blasresistance or durability
the only method I can find is getBlastResistance
there is no setBlastResistance
@warm stirrup yea, I'm talking about the block class
i found this by looking it up https://bukkit.org/threads/changing-block-explosion-resistance.99277/
Is there a way to change the blast resistance of a block? For example instead of 18000 I could change bedrock blast resistance to 2 or something like...
Is there a way for me to add an NBT tag without using a namespacedkey and all? Basically I need those two items (screenshot) to be the same, aka I need to add "repair-cost=1000" to my custom item so it matches the item from a different plugin. https://cdn.discordapp.com/attachments/721357671403487272/737412061327523860/unknown.png
@karmic sable
If someone knows, please ping me
once again its because setGravity for Entity doesnt exist in 1.8 spigot
world#regenerateChunk doesn't work in 1.16, are there any plugins or workarounds?
it definitely exists in 1.16 π€ are you sure you switched versions?
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>```
and reloaded maven
so yes im sure
@warm stirrup that's from 2012 bro
it doesnt give errors in the code
anyone can search it up, I wouldn't have issues if the code existed lol...
but ingame
yeah
i see the same thing you see lol
gotta look for workarounds then Β―_(γ)_/Β―
yeah that's what I am trying to do now
but bukkit is mad annoying
so much redundant code and hard coded fields, it hurts me
Can I make a ticket?
there is a long ass switch statement which returns durability field for a block for EVERY SINGLE BLOCK IN THE GAME
I would like to report somthing
like just imagine writing that switch statement
You're bound to have hard coded fields. You can't really get around it if you want the client and server to understand each other.
? report something like a bug report?
Can I make a ticket?
No a player report
Somthing happened that I believe spigot may want to know about
Do you mean a user on the forums?
Spigot user
Then report their profile
Ok
Press the report button
Ok
is PlayerInventory#remove async safe?
No
Anything that isn't explicitly states as being thread safe is not thread safe
The only things that should be thread safe would be messaging and particles (since they're just sending packets)
generally speaking, is it safe to add vanilla resource packs along side plugins?
yes
ty π
if im using events
do i have to use @eventhandler again and again for every event or just once
yes
For every method
so every event i do @eventhandler ok thanks
if you're using a separate method for each yes
vehicle.setGravity(false);```
im on 1.16.1
declaration: package: org.bukkit.entity, interface: Entity
docs
if you're using a separate method for each yes
@warm stirrup You can't not use a separate method for each event
yeah thanks
vehicle -> Entity vehicle = world.spawnEntity(entloc, EntityType.BOAT);
So are paper and spigot are for hosting not mods?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Have you tried building the latest version of Spigot with BuildTools?
does anyone know a server hoster thats free and lets u use custom plugins?
yeah but if u use ethernet while hosting it holds up well
how much is it memory intensive to have many worlds on your server? like is having 10 players (not close to each other, let's say every player is 1000 blocks far away from each other) on same world same as having 10 players in different worlds?
10 players in 1 world would probably take up less resources. But I doubt the difference would be large
Have you tried building the latest version of Spigot with BuildTools?
@wraith thicket do you have an idea what it could be if thats not it :/
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
works
But I'm still getting the error:/
huh
@frigid ember The method is most definitely there and working just as it should.
Try on the latest version, which at the time of writing is git-Spigot-9639cf7-0458f60
hello. I am trying to set up a new work with spigot 1.16.1, running java 12.0.1 on ubuntu behind a ngix proxy and OPNsense firewall. I have tcp/udp port 25565 being forward in OPNsense but I am getting io.netty.channel.AbstractChannel$ConnectException connection timed out: no further information.
Am I missing something
I can connect local using the local machine Ip address
@frigid ember The method is most definitely there and working just as it should.
Try on the latest version, which at the time of writing isgit-Spigot-9639cf7-0458f60
@wraith thicket what do I do with thegit-Spigot-9639cf7-0458f60?
Just build the up to date Spigot jar with build tools and you'll get that version of the software
Run the server ...
Oh man, I've been doing all my NMS stuff and totally forgot Paper's NMS can be completely different
sigh....
Paper's TileEntityChest is literally completely different to Spigot like whyyy
What is the plugin for players to destroy only blocks placed by other players so that they cannot destroy the lobby etc.
thanks in advance
Only thing we change is the tick logic?
Coz, you know, ticking chests just for an animation is 10/10
I dont understand you xD
that was for jameslfc19
sorry i am not the best english I did not notice this question
Yeah true, I just extend the spigot TileEntityChest for my plugin and it was resulting in double chest opening sounds π The Paper way is definitely way more efficient π
My extended class basically does the same thing π
Ah nice, Overriding startOpen() fixes it π
Does Paper start loading chunks earlier than Spigot does too?
Because I got some NPE from ChunkLoadEvents due to my plugin not being fully initialised π€¦ββοΈ Only realised after deploying today too π
Shouldn't do? that would imply you're registering stuff before your plugin has init'd
hi, In my plugin i open an inventory, but I dont know how to make that players can put items in that inventory
Well I load my config 1 tick after the onEnable() in Spigot it seems to work fine, but Paper it doesn't. I guess maybe paper loads chunks immediately on that first tick and Spigot doesn't, was a weird find anyway π
any1 could help?
cant player put item on inventory? π
yes he can
when you cancel click event you also prevent this
check your invventory click event code @frigid ember
no
but
on a certain
inventory
how do i check if its a certain inventory
or not
check its title
@crimson sandal register your event when your plugin is fully initialized.
or events*
any1 knows ?
just read chat...
so you can just ask
or google it its simle
checking inventory's title should make sense to everyone
why you cant
really
you can in the inventory click event in 1.13+
why you fucking cant write simplest code
or just ask how
ur funny dude
^
oh boy, if you can't be arsed to look at the documentation, then you're not fit for a programmer.
bruh
are you two kidding me
?
you guys certainly aren't here cuz ur programmers
There's thousands of threads about inventory names
declaration: package: org.bukkit.inventory, class: InventoryView
here 1.15 and 1.16's api are same for inventory view
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
I see
you can just get InventoryClickEvent#getView#getTitle
Inventoryview
@outer osprey just search for worldguard
its what you are looking for
maybe some complicated to you at first times
but you can learn it not very hard
check regions and flags
Does multiverse have a discord?
@vast trench yes it was has
but dont know if it was offical
just search on its spigot page
[01:57:38] [Server thread/WARN]: Lazinq was kicked for floating a vehicle too long!```
How would I deny these types of kicks
idk
does tnt trigger BlockExplodeEvent?
yes far as i know in 1.8
@frigid ember i dont think you can do that without some hack
you can edit spigot.yml when plugin initialize but its not recommended and you wont have latest changed on entire run
theres almost always a way:)
allow-flight is false
so they get kicked in mid air
but uh... turning that to true is not good either
?
do you want to disable this or increase this?
That's also because of allow-flight being false
I want to disable kickking for floating a vehicle too long
nvm in both way i dont think theres a way for this with code
but not in the server files