#help-development
1 messages · Page 1355 of 1
There you have the "Project" tab where your java version is displayed
And under the tab on the bottom there is "SDKs" where you can even download new ones
I believe this change started around Java 9 btw
so, if you install java 11 and higher, it won't make that variable and thus for development purposes you would need to go in make that variable yourself
tal error compiling: invalid target release: 11.0.4 -> [Help 1]
yet
I have it all set to that version
if im using saveResource("config.yml", false), where does the config.yml file need to be? resources folder or src?
resources
weird... its not creating the file oof
lemme see
@lost matrix
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project Core: Fa
tal error compiling: invalid target release: 11.0.4 -> [Help 1]
****
@formal ferry where the file is located is not relevant because the question you are asking involves two very different things
well it created the file but didn't copy the contents
If you want to save the config.yml file into the src directory you most definitely can, just need to update the pom to reflect this so that when you compile, it is placed in the appropriate place inside the jar
otherwise, place it in the resources directory which is the default place to add resources you want in the root of the jar
hmm
not sure why you need to use saveResource(). The saveResource() api stuff is for more customized things that generally doesn't involve the config.yml
well yeah but i also use other files (not config.yml)
Well, then use saveResource for those other things, as for the config.yml just use that as it will do it for you and fails silenty if config.yml already exists unless you tell it to overwrite anyways.
what does your code look like for saveResource()?
what the heck
wack
Im trying to make a texture pack
with custom model data
oh my god there's a popup
and I don't know anything
@jade perch lombok copypasta
idk what this file is
just had it for some reason
that's interesting
oh this is from cyberstart america
gone are the days of ?paste
we now have this
actually probably not mobile users exist still
Wait... whats that and whats the markup for this?
My error: https://paste.md-5.net/tagexixiba.sql
Plugin.yml: https://paste.md-5.net/udiqujatev.http
Main: https://paste.md-5.net/fecumoheni.java
I'm pretty new to java, and I dont understand what's wrong... Can someone pls help?
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
ya but i have a plugin.yml...
not in your jar
still doesn't work. new error: [Server thread/ERROR]: Could not load 'plugins/NetherOverworldTEST2.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[minecraft_server.jar:3029-Spigot-79d53c2-e9ad7cb]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[minecraft_server.jar:3029-Spigot-79d53c2-e9ad7cb]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:382) ~[minecraft_server.jar:3029-Spigot-79d53c2-e9ad7cb]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[minecraft_server.jar:3029-Spigot-79d53c2-e9ad7cb]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:918) ~[minecraft_server.jar:3029-Spigot-79d53c2-e9ad7cb]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[minecraft_server.jar:3029-Spigot-79d53c2-e9ad7cb]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more
same error
how do i fix
your plugin.yml has be be included in your exported jar
it is tho...
its not
open your jar with 7zip or any compression util
There will be no plugin.yml in the root.
If you upload a file it will automatically detect the language and then give you the different syntax highlighting
as well as the different look
and you can change the language if you want
yeah
actually it's been there
I like the popup
Imagine relying on conclure
Tooootally isn’t me
google it
exactly
exactly
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
ItemStack itemStack = new ItemStack(Material.DIAMOND_PICKAXE);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.spigot().setUnbreakable(true);
itemStack.setItemMeta(itemMeta);```
i betcha the first link has the answer
You need to learn java first
atleast a bit of java
Learn Java first
learn Java first
You will not be able to do that without at least a BASIC understanding of Java
hang on... Essentials?
You are in the wrong channel. #help-server
How can I open an inventory from a different class?
add a getter to retrieve a reference to your inventory
getter/setter
I checked and there was a plugin.yml in the root...
Not in your jar there wasn't
I just solved it by an extremely disgusting way, by recreating the same inventory in another class, this is just disgusting
You'd do better by creating an inventory/item store/manager
all your inventories and Items get created in your store
Slow down, I have been coding for like not over 2 weeks in spigot
literally create a class called InventoryManager
in your plugin root you create an instance of it
but its a little bit too late, I would have to recode alot of stuff
then anythign that needs an inventory/item it just gets the store/manager and grabs the item
Ok
thx for the idea
what?
Why does the constructor not work???
show what does not work
wait I think I fixed it
okaay
Oh no
So
xD
So I have put this in class menu,right?
menu plugin;
public menu(menu plugin) {
this.plugin = plugin;
}
however since my dumbass got confused af
okay
I somehow need to summon this class from class clickevent
so I can use an inventory from class menu
public menu(JavaPlugin plugin) or you are probably using Main
plugin will not be an instance of menu inside the menu class
English please I dont understand this
no, its inside clickevent class
a class called menu you are passing a menu object to
to clickevent
re-read yoru constructor. menu is not plugin
plugin is yoru main class
what is the earliest event, where i can kick the player with a message he has to verify
It cant be any other class?
PlayerLoginEvent?
AsyncPlayerPreLoginEvent
plugin is your MAIN class. The only class that extends JavaPlugin
something like that
there is no player in the asyncpre event
it doesn;t exist yet
getUniqueId()
doesnt exist
menu JavaPlugin;
public menu(menu JavaPlugin) {
this.JavaPlugin = JavaPlugin;
}
?
ah
@quaint mantle no
what no
declaration: package: org.bukkit.event.player, class: AsyncPlayerPreLoginEvent
ahh confused
ah i see
true the uuid exists. ty
so i can just get the player from the uuid i guess?
main plugin;
public menu(main plugin) {
this.plugin = plugin;
}```
There is NO player
my main class is main so I just put instead of JavaPlugin main
no, JavaPlugin
what
there, I fixed it to use main, Is your main class really lower case m?
Please learn about Java syntax and camel case.
your plugin is called 'main'?
a class shoudl always start capitolized
I know whats camel case dont worry, I need to learn basic Java
Thats new
so Main and Menu not main and menu
ty
methods and fields start lower cased
please learn at least basic java before trying to make a spigot plugin
Hah I tought everything starts lowercased
nah most things, but Classes, Interfaces start upper
I had issues with it, its hard
where did you start trying to learn it
Everyone starts somewhere. You are getting there slowly
I tried it half a year ago, didnt understand shit, tried spigot, also didnt understand shit, so I learned html, css, a very little bit of javascript, linux and amateur pentesting and now I came back to java/spigot after half a year, and I mostly understand stuff I work with, unless its something I have never worked with before.
why da hell is your class lowercase
already covered
Wellllll, now I dont know how to make it so I can use the menu inventory inside Clickevent class
plugin.menu?
if you create yoru Menu instance in yrou Main class you do Menu menu = new Menu(this);
so I can delete
public menu(JavaPlugin plugin) {
}
private final main plugin;
public clickevent(main plugin){
this.plugin = plugin;
}
?
stored as a Field you can either make it public so any class with access to Main can use plugin.menu, or the correct way is to make it private and add a getter so they use plugin.getMenu()
I'm currently doing this:
this.banDAO = new OxideDAO<Ban>(Ban.class, this.datastore);
But I'd rather do this:
this.banDAO = new OxideDAO<Ban>(this.datastore);
I have this:
public class OxideDAO<T> extends BasicDAO<T, String> {
public OxideDAO(Class<T> entityClass, Datastore datastore) {
super(entityClass, datastore);
}
}
How can I do that?
Do you not get an error on that with a hidden type?
perhaps not
You probably won;t be able to do what you want like that due to type erasure
I don't get an error from what I'm currently doing
oh that's sad
Would I be able to do new OxideDAO(Ban.class, this.datastore);?
I'd think not
i guess this is the easiest way to give me a 6-digit random code?
ThreadLocalRandom.current().nextInt(100000, 999999)```
no
what instead?
nope nvm
how
create three random ints (0 - 256), then Integer.toHexString(number)
concat and you have a 6 digit string
as its Hex it will always be 6
what is (number) in this case?
each random int
simply converts it to a hex value
perhaps that won;t work. it also strips preceding zeros
found this on the internet, idk if that works tho
int number = ThreadLocalRandom.current().nextInt(999999);
String code = String.format("%06d", number);```
public int randomRgb() {
final ThreadLocalRandom random = ThreadLocalRandom.current();
final int r = random.nextInt(0xFF);
final int g = random.nextInt(0xFF);
final int b = random.nextInt(0xFF);
return (((r << 8) + g) << 8) + b;
}
Didnt test
I remember when we wrote code using punch cards. Bits at a time
Wouldn't << 8 basically times the number by 64?
lol
I find them operations confusing :/
same
its just twos compliment. 1 2 4 8 16 32 64
public void Random(EntityDamageEvent e) {
if (e.getEntity() instanceof ArmorStand) {
e.setCancelled(true);
if (e.getDamage(EntityDamageEvent.DamageCause.ENTITY_ATTACK)) ;
}
}
}
``` on the '(EntityDamageEvent.DamageCause.ENTITY_ATTACK)' It gives me an error.. The error is:
**'getDamage(org.bukkit.event.entity.EntityDamageEvent.DamageModifier)' in 'org.bukkit.event.entity.EntityDamageEvent' cannot be applied to '(org.bukkit.event.entity.EntityDamageEvent.DamageCause)'**
Can't you just check if e.getCause() == DamageCause.ENTITY_ATTACK?
did you actually do that
Just thought of that now
yes
Who?
in my 50's
lol yep 🙂
Elgar old af
interesting
mhm
Or we are all just children...
hm...
lol
maybe
if(e.getCause() == EntityDamageEvent.DamageCause.ENTITY_ATTACK) {
You mean like this?
Yes
From what ive read so far in this dc more "probably" thant "maybe"
Yeah but It gives me a warning: 'if' statement has empty body
Normaly when I get this warning the whole code doesn't work
...
Should I really care about it?
no body means you havn't put any code inside the { } yet
what is the most effecient way to check if a player is in a claimed chunk without lagging the server
oh
@torn jewel what claim plugin?
making a custom one
Do you have claimed chunks in your plugin yet?
i want to check if a player is in a claimed chunk
that is why i want to know the best way
then check when they move between chunks
I posted some simple code to check that a couple of days back
Check the move event and check the chunk the player enters if equal to a claimed chunk... I think that would work...
Not sure if its most efficient
Yeah but, Is there no way to do so It sends a message to the one who clicked the armor stand?
if (e.getEntity() instanceof ArmorStand) {
e.setCancelled(true);
if(e.getCause() == EntityDamageEvent.DamageCause.ENTITY_ATTACK) {
e.getEntity().sendMessage("Testing");``` e.getEntity is the armorstand
e.getEntity().getDamager
There's no such a thing?
1 sec
armorstands have their own interact events that may fire.
It doesn't find something like "getDamager"
so uh, I'm kinda confused about how knockback works with packets...
is PacketPlayOutEntityVelocity used to tell the client their knockback?
Thanks a lot bro, Thanks for your time!
: ]
But I have a question
The best way to know if an action occurs in a certain chunk?
Checking if a player enters a certain chunk would look like this:
@EventHandler
public void onMove(PlayerMoveEvent event) {
Location from = event.getFrom();
Location to = event.getTo();
int fromX = from.getBlockX() >> 16;
int fromZ = from.getBlockZ() >> 16;
int toX = to.getBlockX() >> 16;
int toZ = to.getBlockZ() >> 16;
if (fromX == toX && fromX == toZ) {
return;
}
System.out.println("Player moved from Chunk " + fromX + "|" + fromZ + " to " + toX + "|" + toZ);
}
huh
:p
Did I check docs?
omg, Thanks a lot for your time!
:p
;p
;p
UwU
OwO
rlly
oh no
so about knockback... is PacketPlayOutEntityVelocity used to tell the client that or is it something else?
ùwú
Yeah but, how do I do so It will equip the damager armor?
There's no "e.getDamager.setHelmet()"
check on getDamager().getPlayer()
should i just loop through all claimed chanks and just see if the player is in one of them
then what
i am trying to figure out if a player is in a claimed chunk
check if that chunk is a claimed chunk or whatever
@rapid vigil
if (event.getDamager().getType() == EntityType.PLAYER) {
Player player = (Player) event.getDamager();
player.getInventory().setHelmet(new ItemStack(Material.DIAMOND_HELMET));
}
yeah get the player's location and then get that chunk. check if that chunk is claimed or not and then you have your answer
Thanks a lot for your time!
yw
Thanks again.
now would anyone have any information to share on my knockback question?
Maybe me
so about knockback... is PacketPlayOutEntityVelocity used to tell the client that or is it something else?
I already have...
or refer to https://wiki.vg/Protocol
I'm getting some sort of velocity packet, but when I send a PacketPlayInFlying.PacketPlayInPosition back, nothing happens and the player stays in place
Hey there, does anyone know if there is an api equivalent to the locatebiome command?
probably not (the api I mean probably does not exist)
Hi! Im having quite a bad time wrapping my head around this problem I have: I need to call a sync class from an async one?
Nms itll be I suppose then :/
Take a look at BukkitRunnable
Bukkit.getScheduler().runTask
ugh...
no matter what I do, using PlayerConnection.a(PacketPlayInFlying packetplayinflying) never moves the player
Guys, can anyone help me with a command to remove all the armor stands in the world?
doesn't matter it says all worlds, cause there's code in the second message for one world
thank :p
then just check each entity to see if its an armor stand and kill it if it is
kill @e[type=armorstand] perhaps?
thats vanilla MC
Yeah I know
/minecraft:kill
You did ask for a command to kill all armorstands in the world
or world#getEntitiesByClass(ArmorStand.class).forEach(
Anyone know if there's a generic way of getting a nms Entity from a CommandSender?
How do i use ths?
Thanks, Justsnoopy30, That helped.
oh my gosh
the thing actually moved
finally
lmao it b-hopped to the edge of the map at turbo speed 😂
How would I scan the player inventory for an item and if they have said item i want to take the item
Player.getInventory().contains(ItemStack)
ok
would I put that in an if statememnt
Well you could do if(Inventory.first(ItemStack) != null) {}
does that get the first slot?
Yeah it gets the slot sorry so need to do Inventory.getItem(slot) after
?jd look it up
package index
ok so I do the frist thing which is just get inventory and then how do I get the slot number of the item if I find it
sorry if i'm being slow @stone sinew
Inventory i = Player.getInventory();
ItemStack item;
int slot = i.first(ItemStack);
if(i.first(ItemStack) != -1)
item = i.getItem(slot);
// or
if(i.contains(ItemStack, 1))
item = i.getItem(slot);
@deft sedge
It means the first slot that contains that item
OHHH
question:
how can i remove 1 key from a config? looks like this:
homes:
keys:
<uuid>:
- key1
- key2
- key3```
and i only want to remove for example key1
just make it empty or set it to null
for lists you will need to grab the entire thing as a list and then remove what it is, then re-save the list
Read wrong sorry...
List<String> s = YamlConfiguration.getStringList(<key>);
s.remove(s.indexOf(string));
YamlConfiguration.set(<key>, s);
and theres the code for you in what I stated 🙂 ^
?jd
package index
Anyone knows how to get the "plugin" arg in an external class?
google java dependency injection
external as in other than the main class?
yeah
How i sometimes do it is
Plugin plugin = (Bukkit.getPluginManager().getPlugin("<Name_Of_Plugin>"));
However i imagine there are better ways
Dependency injection
The name of the plugin is the one stated on the "plugin.yml" file?
Yes
Thanks!
Please use DI or a static singleton
static singleton pog
I don't like DI for events
it's code smell but idgaf it's my code
is there anyway spigot can add an API for configuring the nametag viewable distance, or it is a minecraft limitation?
Specifically this.
https://www.reddit.com/r/minecraftsuggestions/comments/l9dd4p/mob_holograms_should_have_a_configurable_view/
yes.
yes it is possible?
if there was they would've done it
instead of making a suggestion
There is no configurable range for this, it is a hard-coded range built into Minecraft.
it's a client-side thing
dang, just thought I'd check
are netty's player's channel pipeline threads synced with NMS main thread?
or you need to schedule a task through scheduler in order to get the code functionality synced with thread?
i guess not
does || return true if both of the tings being compared are true?
either
**and **returns true if both are, or returns if either are true
but can or return true if both things are true?
its basic logic. You already have the answer
ok
if first expression is true it returns, no matter if the second expression is false
trueBool || falseBool -> trueBool
yea ik how it works
i was just worried it wouldn't return true if both of the tings are true
but i guess so
it wouldn't even reach that if first condition is true and second condition even is condition is true or false
if either of these things are true, return true
nothing in there says but don;t return true if both are true
np
srry for dumb question
np
How can I send the user a message with tabs?
I know it sounds weird, but I want to render my city into minecraft. I want to use openstreetmap, but the problem is: how can I check the height, if it's a home, a road or a park.... so somebody knows?
what u mean with tabs?
"---Kill Count----"
"Players 0"
"Zombies 0"
The space normally generated by the tab key
Just why. Please don't bring this to our attention in this channel....
You can't "use" tabs in a sendmessage but you can simmulate it. Java has the \n for a new line and a \t for a tab. but in chat is this:
dunno
You cant. The messages are font dependant. So each font might have different distances between characters.
There is no way for unified messages unless you enforce a monospaced font with a resourcepack
I understand, thank you very much
why does my PlayerInteractEvent go off twice? im checking for a right-click on a block, and i already have a check for if the hand is off hand yet it still goes off twice 🤔
i'll check to see if i registered it twice but i doubt it
plugin.getServer().getPlayer(string)
Question is there a reason why getConfig() always loads defaults?
if you make changes you have to save them
How do I prevent players hotkeying items into the crafting table in their inventory?
Cancelling InventoryClick doesnt work
InventoryClickEvent
Wdym if you make changes?? You edit config some time but I don't see reason for that being set to default
doesnt cancel
If you make changes via code you have to save those changes
hotkeying into crafting table isnt actually clicking any item
you're just clicking air
I do have that:
try {
ConfigUpdater.update();
saveConfig();
} catch (IOException e) {
Logger.error("Failed to update config.yml");
e.printStackTrace();
}
FileConfiguration config = this.getConfig().options().copyDefaults(false).configuration();
// Settings
HopperSettings.load(this, config);
ParticleSettings.load(config.getConfigurationSection("particles"));
Messages.load(config);
Bukkit.getOfflinePlayer(UUID)
from there you can check if they are online
Hotbar in InventoryClickEvent https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryClickEvent.html#getHotbarButton()
get the offline (safest). Check if online in the offline object, then it has a getPlayer.
K
But is there not a way to get the player object from a uuid
not directly
K
you have to make sure there is a Player object
only players who are online have a player object
Well I am storing player uuids to a map list
good, UUID rather than player
Ok I’ll ask later gtg
you could call Bukkit.getPlayer(UUID) but you'd have to check the return as it may not be available (null)
[18:21:11 WARN]: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'COINS' in 'field list'
does someone knows how to fix this?
im new to SQL
well the error its pretty descriptive
you dont have coins column in ur table
how i make one?
Is this your plugin?
yea
i watched some SQL tutorials from TheSourceCode
and i made my own version but didnt work so i had to copy..
SQL connects perfectly
java.sql.SQLException: Illegal operation on empty result set.
sec
System.out.print(results.getInt("COINS"));
how exactly
you create that table
and what statement you use to get the coins field
sec
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is not a virus
how can i setup database and tables from my plugin?
why is everything static?
also you never check if if results.next is true
you just go to the value
also does the player have a coins value? (not null)
should have a value of 0 by default
a sqltemplate https://pastebin.com/yY4jyLCd
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
sqlite*
The result set is empty, meaning there are no entries matching your statements
thanks ❤️
methods are sync at base,if you want extra performance you can async them
with completeablefutures/bukkitrunnables
but its eh eh... its a sqlite so its rather fast af
https://sourceb.in/3HUciQH9Oi - so the bossbar doesn't disappear, unless I relog then its gone
for new version if i remember right
you need to grab the bossbar instnace
from the player
if you want to use a sqlite you have a template above
its same syntax,just changed getconnection
however someone mentioned the problem and i also mentioned it
you never check if the result is a valid one
result.next returns a boolean beside loading the next result
in your case result is invalid
i now understand
also things should always have a value if they dont allow nulls
in your case you should preset a player to 0 coins
also the 2nd problem you will face
as your using mysql
you need async interaction
👀 sqlite syntax and mysql syntax isn't exactly the same
I wish it were
in a way.. not that much changed
ik there are some null rules
for mysql or sqlite
so you cant do everything on both
instead of static abusing, r u meant to call a static instance of the class or sumn?
dependency injection
i usually go with a class holding everything related to sql then OOP
i have a handler for sql then i use it in a storage class
there i make the async stuff
guys, how do you create GUIs in abstract way?
i've got an abstract class GUI that other gui classes extend
abusing inventoryholder
HashMap.get(uuid)
will retreive the int stored
so... you can use how much they have to... check if they have another amount...
not rly sure... i get the question
HashMap.get(uuid)>500
well in your case
=amount
This beginner Java tutorial describes fundamentals of programming in the Java programming language
@quaint mantle I'm going to guess you haven't explained very well. Are you talking about finding if a player has more than X amount of an item?
^
posted a link above with java operators
is it possible to stop players from holding right click on a button and making them press it manually every time(1.16)
?
buttons? Ingame buttons only single click activate
you can hold right click on a button and it will click every time
wighout pressing it manually
you can just hold it
are you talking about things like stone buttons?
yes
odd, I've never known any auto repeat on a button
try it out. Place a stone button and hold right click on it
ah I see
The answer would be no. thats client side would be my guess.
No way on the server to detect if a click was a press click or a repeating click
The thing is I saw a server fix it somehow. That was on 1.8 though.(The issue is also present on 1.8 so its not like its a new feature). They patched it somehow and I don't know how
modded server?
vanilla
I don;t see it would be possible on vanilla
unless there is some packt that signifies the click type, in which case you'd have to look at ProtocolLib
Anyone know why dependecnies don't work after adding them through project stuctures > libraries > Java > Adding jar file
exporting jar or using maven or gradle?
Uhh it's a plugin im adding as a dependency sooo I believe its external
he is probably using export when he is not modifing the pom/build.gradle
maven
as I thought 🙂
then you need to add it to your pom.xml
when using Maven you add dependencies to yoru Pom, never in your libs
But it's a jar file
SiegeWar XD
this one? https://github.com/SiegeWar
I have a bunch of uuids stored to a map. I want to convert the uuids back into player objects. How would I do that?
Nah this one: https://github.com/TownyAdvanced/SiegeWar
Please @ me if responding
goto the Towny discord and they'll give you all the help you need
Bukkit.getPlayer
alright thanks
ok bukkit.getPlayer and then the uuid?
yep
thx
Sup, anyone knows how to edit bats pathfindergoals or make them attack players?
Cuz they are different from normal ones
normal mobs*
paper? Then you can use their pathfinderapi. If not you need to use nms
why wouldn't they?
I dont know 😄
cant make them attack players
Ive made pigs attack players etc
but cant do the same with bats
they are an entityinsentient so it should work
you can try it
4real
it doesnt work
meleeattack pathfinder goal
does not work
even clearing all their pathgoals wont work
1.16?
mhm
im looking into spigots code right now.
ignore the fox-speed
just need to change that to bat
but that works with all the other mobs
not with bat
I dont know
If it does
or doesnt
Just this piece of code does not work
gives this error
The constructor PathfinderGoalMeleeAttack(CustomBat, int, boolean) is undefined
PathfinderGoalMeleeAttack is a custom goal right?
nope
Its spigots goal
or minecraft's goal
i mean whatever yea xd its not done by me
its built in
Ookay. So what should I do?
create your own goal and copy paste the code from minecrafts. I don't know if all methods are there in the bat class though
So
create my own goal and try using that pathfindergoalmeleeattack on my custom goal_
?
How do I make something fall faster
Like increase gravity
just create your own goal and copy paste the minecraft code(decompile your server jar. If you are using IntelliJ as an IDE you should be able to grab the code by shift clicking on PathfinderGoalMeleeAttack. If not just use some decompiler other than the built in).
Then you need to modify it to support your bat
it's an armorstand
im not sure if my knowledge is strong enough to do that 😄
but as thats my only chance
ill try it
where's the y velocity
then?
and set the velocity to 0 -1 0
that should make it fall a bit faster
not sure how much
Not 100%
but thats the most logical way i can think of
I mean
also check
if its not onground
so if armorstand.!isOnGround
ofc you add parantheses and everything
annnnd?
The server sees the /config command. Likewise, the folder of the plugin comes to the plugins folder and the config is created there. But the message does not come when I type /config from the game -_-
any idea?
you renamed the onCommand method
and you should move your command to a seperate class
tf is yaniKomut
thinking the same thing
Can't we give the name we want?
No
you are overriding a method so: no
It overrides the method
Event methods Can because you’re using the @brave glenhandler annotation
your config command is also not valid in your config. It needs at least a description or useage child to be valid
hi. is there a way, to stop an invisible entity spawned with packets (which is the passenger on your head) hiding your nametag?
That's not possible
put a paper on it
No
No paper allowed
Paper makes things bad
Only fuels the fire
put some p u r p u r powder on it
or some tunitied paper that cant burn
or any workarounds?
did any1 say 🚰
😄 🚰
Heya - At the moment, I just do this to manage GUIs so people can't take or put items inside. For some reason though, they can still use their hotkeys to put items in
if (!e.getInventory().equals(inv)) return;
if (e.getClickedInventory() == null) return;
if (e.getClickedInventory().getType().equals(InventoryType.PLAYER)) { e.setCancelled(true); return; }
if (e.getCurrentItem() == null) return;
if (e.getCurrentItem().getItemMeta() == null) return;
e.setCancelled(true)
It's the water department 🚰
i live and die for 🚰 🚰 🚰
🚰
Peeps, OT is not OK when there are active questions in chat
o god a world without 🚰 without water? ;-; noooooo
Yes we will go to general sorry
o shit i thought i was in general lol, caught in 4k
Appreciate it chief
in 1.12 i could use AREA_EFFECT_CLOUD. is there something similar in 1.8? or any workarounds? fixes? how can i restore the nametag of the player over the entity which is blocking it?
HI guys, i need help!
how to change horse settings?
like how is the owner
or staff like that
cast to Tameable?
same
do you have any idea on my problem? @eternal oxide
Afraid not. I've never used packets
:/
error
Player p = (Player) sender;
Entity horse = Bukkit.getWorld("TrestiaMap").spawnEntity(new Location(Bukkit.getWorld("TrestiaMap"), 229, 44, -340), HORSE);
horse.setCustomName(ChatColor.GREEN + plugin.getConfig().getString("horse name:"));
horse.setGlowing(true);
horse.setGravity(false);
horse.setOwner("danos360");
setOwner doesn't take a name
make it horse.setOwner(p);
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/AnimalTamer.html
what api-version do you use?
((Tameable) horse).setOwner(p);
let me test it
bump ⬆️
hey
is there something similar in 1.8? no
or any workarounds? fixes? no
how can i restore the nametag of the player over the entity which is blocking it? < - ?
Can you not set the custom name visible after you set the riding entity?
hey, thanks for you answer.
the player nametag vanishs if there is an invisible entity riding on the player. i want to avoid that. thats meant by it
sadly not
in that case could you set the name on the riding entity to the same as the player?
do you modify the player name tag somehow?
then set that visible
never.
already tried. the entity is blocking every type of interaction
if i just show it to other player, not to the player wearing it, pvp is nearly not possible
maybe it's a matter of receiving client packets?
already checked. didn't found a way of returning or cancelling it
& also mineplex did it somehow, so it have to be possible.
see here -> http://prntscr.com/111x7m2
you can see, that the player name doesn't bend, because it's the normal nametag.
String rankname = getRankName(p);
PermissionAttachment attach = p.addAttachment(this);
rankattachment.put(p.getUniqueId(), attach);
//rank.put(p.getUniqueId(), rankname);
FileConfiguration file = RanksFile.getFile();
for(String perm : file.getStringList(rankname + ".Permissions")) {
rankattachment.get(p.getUniqueId()).setPermission(perm, true);
p.sendMessage(perm);
}```
perms doesnt work
but gets sent in the chat
what did i do wrong
You should probably use the Vault API
After adding yoru perms do attach.getPermissible().recalculatePermissions();
nah i dont like vault
is it possible to find everything but a certain string in regex? i have \\[Staff\\].* and it finds everything that starts with [Staff], but i would like to find everything that doesn't
do a split on Staff
You could do "negative look around"
Tho I'd highly recommend implementing the negation logic in code 😅
Hi, what are the armor slots id ?
Hello, I want to scan a player inventory for an item, and then delete said item. How would I go about doing that?
Get the inventory, loop through it when you find the searched item just check if it has more than 1 in the amount if so just remove one from the amount otherwise remove the said item from the inventory
Aren't those one for the player.dat file ? The inventory doesn't have the same id normally
yup
since when do you modify these in spigot lol
through id
they all have their setters/getters
I need it to check if the player clicks on the head slot
If you have a SlotType#HEAD
that would be cool
But there is only the ARMOR slot type
So, I need the slots id ^^
And there are so much screens with different numbers that I don't know which one to believe ^^'
I think they are just followed up from inventory in spigots case
so given that 0-35 are main inventory
36-39 are your armor slots
Ok thanks, I'll give it a try ^^
ok ^^
EDIT: It's 36 - 39 ^^ Thanks @eternal night
how would I set the color of a leather piece of armor?
I got the item meta but .setColor doesnt work
you casted it ?
Well yes
because not every item can by dyed
so, just like with skulls or banners or anything that has special values
you have to cast the item meta instance
in your case LeatherArmorMeta
declaration: package: org.bukkit.inventory.meta, interface: LeatherArmorMeta
ty
^ just make sure that the item can actually be coloured
else you'll enjoy some errors
ok
hello
I know this is a noob question but how do i get a function to return data back to the function caller
ik u can use return
idk\
but from the caller hod do you then get what the function returned
ill try
so my plugin is not downloading
it is stuck at this Building plugin...
Generating build directory...
Generating source code...
Generating pom.xml...
Generating plugin.yml...
Executing maven tasks...
even if I wait for 3hrs
what code software do u use
the Visual bukket
I've never even heaerd of said ide
for trying
o
Mmmmh is that normal that in gamemode 1 the inventory click event isn't fired ^^' ?
creative has its own events
I know this is a noob question but how do i get a function to return data back to the function caller
ik u can use return but how do i get the actual return value back to the snder
and sotre that to a var
Oh ok
@eternal oxide u provbably know
a method definition has a return type ie public void or public boolean
Mmmh there is still the same problem even with the InventoryCreativeEvent. When I click on an empty slot, it doesn't fire the event :/
k
void means there is no return type
ok so if i'm gonna return something then i need a boolean
@opal sluice do you have @Eventhandler? is the event registered?
a boolean you can only return a boolean
does anyone know how to fix my problem?
Yeah, the event fires when there is something in the clicked slot
you can return any type you need
so my plugin is not downloading
it is stuck at this Building plugin...
Generating build directory...
Generating source code...
Generating pom.xml...
Generating plugin.yml...
Executing maven tasks...
even if I wait for 3hrs
creative client is known to not send all interact packets I believe o.O
hello
Oh rip
you're gonna have to provide more info
what are you trying to do?
clicking on an empty slot will not fire the event as it has no action
What i'm not understanding though is , say I call a function in a class. That function runs and produces the output I do return <output>; then how do I get that return value back into the class that I called it from
I am trying to make it so that
I mean empty slots fire events in survival xD
variable = function()
variable will be assigned to the return value of function
ok thanks
omg
you should probably find a more dedicated support channel for that
yes we know visual bukkit, but its not supported here
it is like scratch
ok
I have never seen this
people here only know about actual java
this is for straight up coding
Wow first time I see someone using it hahaha
I know java
ya'll are mean XD
I mean no shame in using it
even skript is better than that 🙂
just never saw it
@jaunty epoch try using intellij
for me it's the esiest acutal coding
I mean if u wanna actually kode
yea lol
I know script is better


